From 104bbc50e7cfa97d92fc956e6667e5f7bd69b55c Mon Sep 17 00:00:00 2001 From: GAEHWILER Reto Date: Wed, 26 May 2021 10:13:50 +0200 Subject: [PATCH] Fix skipping sectors at computing the number of free clusters Double increment of sector made computation skipping every second sector and to go beyond fat-table! --- fs/fat/fs_fat32util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/fat/fs_fat32util.c b/fs/fat/fs_fat32util.c index 0fdfeaa3863..e9f5079ea7c 100644 --- a/fs/fat/fs_fat32util.c +++ b/fs/fat/fs_fat32util.c @@ -2074,7 +2074,7 @@ int fat_computefreeclusters(struct fat_mountpt_s *fs) if (offset >= fs->fs_hwsectorsize) { - ret = fat_fscacheread(fs, fatsector++); + ret = fat_fscacheread(fs, fatsector); if (ret < 0) { return ret; @@ -2154,7 +2154,7 @@ int fat_nfreeclusters(struct fat_mountpt_s *fs, off_t *pfreeclusters) } /**************************************************************************** - * Name: fat_nfreeclusters + * Name: fat_currentsector * * Description: * Given the file position, set the correct current sector to access.