Fix bug in offset computation

This commit is contained in:
Baptiste Wicht 2014-02-27 22:11:12 +01:00
parent 2c1cdcffa5
commit 3d0e50190b

View File

@ -173,7 +173,7 @@ uint32_t read_fat_value(fat32::dd disk, uint32_t cluster){
std::unique_heap_array<uint32_t> fat_table(512 / sizeof(uint32_t)); std::unique_heap_array<uint32_t> fat_table(512 / sizeof(uint32_t));
if(read_sectors(disk, fat_sector, 1, fat_table.get())){ if(read_sectors(disk, fat_sector, 1, fat_table.get())){
uint64_t entry_offset = cluster % 512; uint64_t entry_offset = cluster % (512 / sizeof(uint32_t));
return fat_table[entry_offset] & 0x0FFFFFFF; return fat_table[entry_offset] & 0x0FFFFFFF;
} else { } else {
return 0; return 0;