From: Jo-Philipp Wich Date: Thu, 25 Jul 2013 12:23:07 +0000 (+0200) Subject: block: discard vfat labels with only spaces X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fubox.git;a=commitdiff_plain;h=7c922b0f11c4450d0b5fd04d886eed64b2cf7abf block: discard vfat labels with only spaces --- diff --git a/libblkid-tiny/vfat.c b/libblkid-tiny/vfat.c index dd53d68..ef66769 100644 --- a/libblkid-tiny/vfat.c +++ b/libblkid-tiny/vfat.c @@ -277,9 +277,12 @@ static int set_label(blkid_probe pr, unsigned char *vol_label) { unsigned char *c; - for (c = vol_label + 10; c > vol_label && *c == ' '; c--) + for (c = vol_label + 10; c >= vol_label && *c == ' '; c--) *c = 0; + if (!*vol_label) + return 0; + return blkid_probe_set_label(pr, vol_label, 11); }