Changes by: cha0smaster
Update of /cvsroot/linux-ntfs/ntfsprogs/ntfsprogs
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21587/ntfsprogs
Modified Files:
ntfsmount.c
Log Message:
fix potential bug
Index: ntfsmount.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/ntfsprogs/ntfsmount.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -p -r1.32 -r1.33
--- ntfsmount.c 24 Sep 2005 16:19:29 -0000 1.32
+++ ntfsmount.c 24 Sep 2005 17:06:35 -0000 1.33
@@ -103,18 +103,18 @@ static long ntfs_fuse_get_nr_free_mft_re
if (!(ctx->state & NF_FreeMFTOutdate))
return ctx->free_mft;
- buf = malloc(NTFS_BUF_SIZE);
+ buf = malloc(vol->cluster_size);
if (!buf)
return -ENOMEM;
while (1) {
int i, j;
br = ntfs_attr_pread(vol->mftbmp_na, total,
- NTFS_BLOCK_SIZE, buf);
+ vol->cluster_size, buf);
if (!br)
break;
total += br;
- for (i = 0; i < NTFS_BLOCK_SIZE; i++)
+ for (i = 0; i < br; i++)
for (j = 0; j < 8; j++)
if (!((buf[i] >> j) & 1))
nr_free++;
@@ -135,18 +135,18 @@ static long ntfs_fuse_get_nr_free_cluste
if (!(ctx->state & NF_FreeClustersOutdate))
return ctx->free_clusters;
- buf = malloc(NTFS_BUF_SIZE);
+ buf = malloc(vol->cluster_size);
if (!buf)
return -ENOMEM;
while (1) {
int i, j;
br = ntfs_attr_pread(vol->lcnbmp_na, total,
- NTFS_BLOCK_SIZE, buf);
+ vol->cluster_size, buf);
if (!br)
break;
total += br;
- for (i = 0; i < NTFS_BLOCK_SIZE; i++)
+ for (i = 0; i < br; i++)
for (j = 0; j < 8; j++)
if (!((buf[i] >> j) & 1))
nr_free++;
|