summaryrefslogtreecommitdiffstats
path: root/src/fatp.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2007-11-16 09:04:41 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2007-11-16 09:04:41 +0100
commitb7d3c98ee6faa0b75d2f2a559baa656f8546848e (patch)
treec4e824e4006eeb4e681a6dee20a43ce20d4e795d /src/fatp.c
parent455ed826c8a213979aaa69b3af09181ce2b4706c (diff)
Fix for big FAT filesystem
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 f1cc6ca..14cff16 100644
--- a/src/fatp.c
+++ b/src/fatp.c
@@ -67,13 +67,13 @@ static void fat16_remove_used_space(disk_t *disk_car,const partition_t *partitio
if(le16(p16[offset_o])!=0)
{
/* Not free */
- if(end_free+1==partition->part_offset+(uint64_t)(start_data+(prev_cluster-2)*cluster_size)*sector_size)
+ if(end_free+1==partition->part_offset+(start_data+(uint64_t)(prev_cluster-2)*cluster_size)*sector_size)
end_free+=cluster_size*sector_size;
else
{
if(start_free != end_free)
del_search_space(list_search_space, start_free, end_free);
- start_free=partition->part_offset+(uint64_t)(start_data+(prev_cluster-2)*cluster_size)*sector_size;
+ start_free=partition->part_offset+(start_data+(uint64_t)(prev_cluster-2)*cluster_size)*sector_size;
end_free=start_free+(uint64_t)cluster_size*sector_size-1;
}
}
@@ -118,8 +118,8 @@ static void fat32_remove_used_space(disk_t *disk_car,const partition_t *partitio
{
if(start_free != end_free)
del_search_space(list_search_space, start_free, end_free);
- start_free=partition->part_offset+(uint64_t)(start_data+(prev_cluster-2)*cluster_size)*sector_size;
- end_free=partition->part_offset+(uint64_t)(start_data+(prev_cluster-2+1)*cluster_size)*sector_size-1;
+ start_free=partition->part_offset+(start_data+(uint64_t)(prev_cluster-2)*cluster_size)*sector_size;
+ end_free=start_free+(uint64_t)cluster_size*sector_size-1;
}
}
}