summaryrefslogtreecommitdiffstats
path: root/src/fatp.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2008-07-05 22:57:58 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2008-07-05 22:57:58 +0200
commita6b58b4150c20f4f3d1a6ebf80ce41d6ed16e4d5 (patch)
tree9d35982dc8ff9a13c8350ef3d63108d2f3864a89 /src/fatp.c
parent84cd4095ed29660b2258846da9a89f9c8bc2c5d7 (diff)
FAT: Fix confusion between cluster_size and sectors_per_cluster
Diffstat (limited to 'src/fatp.c')
-rw-r--r--src/fatp.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/fatp.c b/src/fatp.c
index aec1233..0294b8a 100644
--- a/src/fatp.c
+++ b/src/fatp.c
@@ -151,12 +151,12 @@ unsigned int fat_remove_used_space(disk_t *disk_car, const partition_t *partitio
part_size=(sectors(fat_header)>0?sectors(fat_header):le32(fat_header->total_sect));
start_fat1=le16(fat_header->reserved);
start_data=start_fat1+fat_header->fats*fat_length+(get_dir_entries(fat_header)*32+sector_size-1)/sector_size;
- no_of_cluster=(part_size-start_data)/fat_header->cluster_size;
+ no_of_cluster=(part_size-start_data)/fat_header->sectors_per_cluster;
if(partition->upart_type==UP_FAT16)
- fat16_remove_used_space(disk_car,partition, list_search_space, start_fat1, no_of_cluster, start_data, fat_header->cluster_size,sector_size);
+ fat16_remove_used_space(disk_car,partition, list_search_space, start_fat1, no_of_cluster, start_data, fat_header->sectors_per_cluster,sector_size);
else if(partition->upart_type==UP_FAT32)
- fat32_remove_used_space(disk_car,partition, list_search_space, start_fat1, no_of_cluster, start_data, fat_header->cluster_size,sector_size);
- res=fat_header->cluster_size * sector_size;
+ fat32_remove_used_space(disk_car,partition, list_search_space, start_fat1, no_of_cluster, start_data, fat_header->sectors_per_cluster,sector_size);
+ res=fat_header->sectors_per_cluster * sector_size;
free(buffer);
return res;
}