static struct vfat_super_block vs;
static struct msdos_super_block ms;
+static int set_label(blkid_probe pr, unsigned char *vol_label)
+{
+ unsigned char *c;
+
+ for (c = vol_label + 10; c > vol_label && *c == ' '; c--)
+ *c = 0;
+
+ return blkid_probe_set_label(pr, vol_label, 11);
+}
+
/* FAT label extraction from the root directory taken from Kay
* Sievers's volume_id library */
static int probe_vfat(blkid_probe pr, const struct blkid_idmag *mag)
return -1;
fsinfo = (struct fat32_fsinfo *) buf;
- *fsinfo->signature1 = le32_to_cpu(*fsinfo->signature1);
- *fsinfo->signature2 = le32_to_cpu(*fsinfo->signature2);
if (memcmp(fsinfo->signature1, "\x52\x52\x61\x41", 4) != 0 &&
memcmp(fsinfo->signature1, "\x52\x52\x64\x41", 4) != 0 &&
memcmp(fsinfo->signature1, "\x00\x00\x00\x00", 4) != 0)
}
if (vol_label && memcmp(vol_label, no_name, 11))
- blkid_probe_set_label(pr, (unsigned char *) vol_label, 11);
+ set_label(pr, (unsigned char *) vol_label);
/* We can't just print them as %04X, because they are unaligned */
if (vol_serno)