Truncate FAT filesystem label until 1st occurance of a blank (0x20)
[project/fstools.git] / libblkid-tiny / vfat.c
index e70dd7565f47c391b5e32d56dbb8fd1121db5457..1bce002827ecfb15072bcb9f730abaecc30e3f08 100644 (file)
@@ -422,8 +422,10 @@ static int probe_vfat(blkid_probe pr, const struct blkid_idmag *mag)
        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)