summaryrefslogtreecommitdiff
path: root/core/fs/iso9660/susp_rr.c
diff options
context:
space:
mode:
Diffstat (limited to 'core/fs/iso9660/susp_rr.c')
-rw-r--r--core/fs/iso9660/susp_rr.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/core/fs/iso9660/susp_rr.c b/core/fs/iso9660/susp_rr.c
index 3d99b749..e758586f 100644
--- a/core/fs/iso9660/susp_rr.c
+++ b/core/fs/iso9660/susp_rr.c
@@ -99,16 +99,13 @@ static int susp_rr_is_out_of_mem(void *pt)
}
-/* XXX: Is there already a reader for 32-bit MSB or LSB in the syslinux code ?
- (iso9660.c seems to flatly assume that it runs on little-endian int.)
-*/
-static uint32_t susp_rr_read_msb(uint8_t *buf, int bytes)
+static uint32_t susp_rr_read_lsb(uint8_t *buf, int bytes)
{
int i;
uint32_t ret = 0;
for (i = 0; i < bytes; i++) {
- ret += ((uint32_t) buf[bytes - i - 1]) << (i * 8);
+ ret += ((uint32_t) buf[i]) << (i * 8);
}
return ret;
}
@@ -277,9 +274,9 @@ static int susp_rr_iterate(struct susp_rr_iter *iter, char **pos_pt)
}
/* Register address data of next Continuation Area */
u_entry = (uint8_t *) entries;
- iter->next_lba = susp_rr_read_msb(u_entry + 8, 4);
- iter->next_offset = susp_rr_read_msb(u_entry + 16, 4);
- iter->next_length = susp_rr_read_msb(u_entry + 24, 4);
+ iter->next_lba = susp_rr_read_lsb(u_entry + 4, 4);
+ iter->next_offset = susp_rr_read_lsb(u_entry + 12, 4);
+ iter->next_length = susp_rr_read_lsb(u_entry + 20, 4);
}
*pos_pt = entries;
@@ -464,7 +461,7 @@ int susp_rr_check_signatures(struct fs_info *fs, int flag)
#endif /* Isolinux_rockridge_in_libisofS */
/* Obtain first dir_rec of root directory */
- lba = susp_rr_read_msb(((uint8_t *) &(sbi->root)) + 6, 4);
+ lba = susp_rr_read_lsb(((uint8_t *) &(sbi->root)) + 2, 4);
dir_rec = (char *) get_cache(fs->fs_dev, lba);
if (dir_rec == NULL)
goto no_susp;