[core] fix computation of FAT size for Large FAT32

* Ridgecropt's GetFATSizeSectors() computation was incorrect
  and resulted in data sectors being "wasted" (unaddressable)
* See: http://www.syslinux.org/archives/2016-February/024850.html
* Also revert the minfatsize check of Syslinux, since it no longer fails.
This commit is contained in:
Pete Batard 2016-02-26 13:26:34 +00:00
parent ade5639c00
commit b9caf8b605
3 changed files with 13 additions and 24 deletions

View file

@ -92,7 +92,7 @@ libfat_open(int (*readfunc) (intptr_t, void *, size_t, libfat_sector_t),
} else
goto barf; /* Impossibly many clusters */
minfatsize >>= LIBFAT_SECTOR_SHIFT;
minfatsize = (minfatsize + LIBFAT_SECTOR_SIZE - 1) >> LIBFAT_SECTOR_SHIFT;
if (minfatsize > fatsize)
goto barf; /* The FATs don't fit */