What about the following change:
/* Earlier version of FF_Format(), kept for compatibility. */
FF_Error_t FF_Format( FF_Disk_t *pxDisk, BaseType_t xPartitionNumber, BaseType_t xPreferFAT16, BaseType_t xSmallClusters )
{
FF_FormatDisk( pxDisk, xPartitionNumber, xPreferFAT16, xSmallClusters, "MY_DISK " );
}
/* Please provide 11 characters in the parameter 'pcVolumeName '. */
FF_Error_t FF_FormatDisk( FF_Disk_t *pxDisk, BaseType_t xPartitionNumber, BaseType_t xPreferFAT16, BaseType_t xSmallClusters, const char *pcVolumeName )
{
and:
- memcpy( pucSectorBuffer, "MY_DISK ", 11 );
- strncpy( pucSectorBuffer, pcVolumeName, 11 );
Note that the label name is filled out with spaces, and it doesn’t have a terminating null character.