According to spec the FAT filesystem label is not terminated by a
\0-byte but instead has a fixed length where the name is padded by
blanks.
Before libblkid-tiny just passed the always 11 bytes long blank padded
string through, however it makes matching for a filesystem label
inconsistent with other filesystems, which use a \0-terminated string.
Before: "foobar "
After : "foobar"
Signed-off-by: Mirko Vogt <mirko-openwrt@nanl.de>
if (boot_label && memcmp(boot_label, no_name, 11))
blkid_probe_set_id_label(pr, "LABEL_FATBOOT", (unsigned char *) boot_label, 11);
- if (vol_label)
- blkid_probe_set_label(pr, (unsigned char *) vol_label, 11);
+ if (vol_label) {
+ strtok((char *) vol_label, " ");
+ blkid_probe_set_label(pr, (unsigned char *) vol_label, 11);
+ }
/* We can't just print them as %04X, because they are unaligned */
if (vol_serno)