From d1c459c746ab79c9bfb6b84aed2e7f60b57db94f Mon Sep 17 00:00:00 2001 From: Jean-Philippe Bernardy Date: Mon, 7 Mar 2005 14:38:30 +0000 Subject: Little fix, when debug is disabled clusterchain length was incorrectly computed git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6163 a1c6a512-1295-4272-9138-f99709370657 --- firmware/drivers/fat.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/firmware/drivers/fat.c b/firmware/drivers/fat.c index df89db3651..79b9dc03d3 100644 --- a/firmware/drivers/fat.c +++ b/firmware/drivers/fat.c @@ -1782,8 +1782,10 @@ int fat_closewrite(struct fat_file *file, long size, int attr) long len; long next; for ( next = file->firstcluster; next; - next = get_next_cluster(IF_MV2(fat_bpb,) next) ) - LDEBUGF("cluster %ld: %lx\n", count++, next); + next = get_next_cluster(IF_MV2(fat_bpb,) next) ) { + LDEBUGF("cluster %ld: %lx\n", count, next); + count++; + } len = count * fat_bpb->bpb_secperclus * SECTOR_SIZE; LDEBUGF("File is %ld clusters (chainlen=%ld, size=%ld)\n", count, len, size ); -- cgit v1.2.3