Skip to content

Commit

Permalink
Fix the volume_sectors recorded in the boot sector of fat16.
Browse files Browse the repository at this point in the history
The function set_u32 was only setting the lowest byte correctly.
The function is only used to record volume_sectors in the fat16 boot sector.
Affects new pcmcia disks that end up with nr_sectors > 255.

Since: c920544
  • Loading branch information
flaviojs committed Mar 13, 2024
1 parent 8b6cd41 commit 017790e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions common/fs_fat.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ static struct {
static inline void set_u32(m_uint8_t *p, size_t i, m_uint32_t v) {
p[i+0] = (m_uint8_t)((v>>0)&0xFF);
p[i+1] = (m_uint8_t)((v>>8)&0xFF);
p[i+1] = (m_uint8_t)((v>>16)&0xFF);
p[i+1] = (m_uint8_t)((v>>24)&0xFF);
p[i+2] = (m_uint8_t)((v>>16)&0xFF);
p[i+3] = (m_uint8_t)((v>>24)&0xFF);
}

static inline void set_u16(m_uint8_t *p, size_t i, m_uint16_t v) {
Expand Down

0 comments on commit 017790e

Please sign in to comment.