FAT: Fixed volume count check when formatted without MBR

This saves 64 blocks (32KB when used with 512B blocks) and drops
the minimum storage size from 64KB to 32KB.
pull/3936/head
Christopher Haster 2017-05-25 14:24:17 -05:00
parent 3f92a15960
commit 3ee77e36f7
1 changed files with 1 additions and 1 deletions

View File

@ -4123,7 +4123,7 @@ FRESULT f_mkfs (
n_vol = LD_DWORD(tbl + 12); /* Volume size */
} else {
/* Create a partition in this function */
if (disk_ioctl(pdrv, GET_SECTOR_COUNT, &n_vol) != RES_OK || n_vol < 128)
if (disk_ioctl(pdrv, GET_SECTOR_COUNT, &n_vol) != RES_OK || n_vol < ((sfd) ? 64 : 128))
return FR_DISK_ERR;
b_vol = (sfd) ? 0 : 63; /* Volume start sector */
n_vol -= b_vol; /* Volume size */