summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Grenier <[email protected]>2025-04-04 18:12:07 +0200
committerChristophe Grenier <[email protected]>2025-04-04 18:12:07 +0200
commit40b52d66ba5284fd701f07700def9004087e0194 (patch)
tree9086d5bb8984b3ff434c1e684f4029d536c2d348
parent0e8167cf9b8540d5130fca8a79fa07b8249cbf49 (diff)
PhotoRec: fix NTFS recovery from free space only.
-rw-r--r--src/ntfsp.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/ntfsp.c b/src/ntfsp.c
index e2cbd98c..3ba09395 100644
--- a/src/ntfsp.c
+++ b/src/ntfsp.c
@@ -104,8 +104,9 @@ unsigned int ntfs_remove_used_space(disk_t *disk_car,const partition_t *partitio
dir_data.close(&dir_data);
return 0;
}
- no_of_cluster=(le64(ntfs_header->sectors_nbr) < partition->part_size ? le64(ntfs_header->sectors_nbr) : partition->part_size);
- no_of_cluster/=ntfs_header->sectors_per_cluster;
+ no_of_cluster=le64(ntfs_header->sectors_nbr)/ntfs_header->sectors_per_cluster;
+ if(no_of_cluster > partition->part_size / cluster_size)
+ no_of_cluster = partition->part_size / cluster_size;
}
for(lcn=0;lcn<no_of_cluster;lcn++)
{