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!
This commit is contained in:
GAEHWILER Reto 2021-05-26 10:13:50 +02:00 committed by David Sidrane
parent 1d940b2982
commit 104bbc50e7
1 changed files with 2 additions and 2 deletions

View File

@ -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.