Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix calculation of cluster amount for FAT16 filesystems in FDISK (#70)
The routine that calculates the amount of clusters for a new FAT16 filesystem in FDSIK has a bug that appears when creating a filesystem with a maximum amount of clusters possible: a 16-bit variable overflows and turns into 0 when it should actually be 65536. This causes the sector count in the boot sector to be higher than the actual size of the filesystem, and thus when writing to an almost full partition a "Disk error writing" error may appear. This commit fixes this by adding an intermediate calculation that prevents the variable from overflowing.
- Loading branch information