Fix a FAT cluster allocation bug. From Tridge
This commit is contained in:
parent
803cdfdaf1
commit
85e7e13bb0
@ -6433,4 +6433,7 @@
|
||||
* configs/px4fmu-v2_upstream: Configuration for testing simple
|
||||
configurations on the the PX4FMU v2. This version is incomplete
|
||||
for the PX4 appliation and is not a replacement for the version
|
||||
in the PX4 GIT repository.
|
||||
in the PX4 GIT repository.
|
||||
* fs/fat/fs_fat32.c: A correction to FAT cluster allocation from
|
||||
Tridge via Lorenz Meier (2014-1-14).
|
||||
|
||||
|
@ -623,7 +623,7 @@ fat_read_restart:
|
||||
* cluster boundary
|
||||
*/
|
||||
|
||||
if (ff->ff_sectorsincluster < 1)
|
||||
if (buflen > 0 && ff->ff_sectorsincluster < 1)
|
||||
{
|
||||
/* Find the next cluster in the FAT. */
|
||||
|
||||
@ -899,7 +899,7 @@ fat_write_restart:
|
||||
* cluster boundary
|
||||
*/
|
||||
|
||||
if (ff->ff_sectorsincluster < 1)
|
||||
if (buflen > 0 && ff->ff_sectorsincluster < 1)
|
||||
{
|
||||
/* Extend the current cluster by one (unless lseek was used to
|
||||
* move the file position back from the end of the file)
|
||||
|
Loading…
x
Reference in New Issue
Block a user