From 7c922b0f11c4450d0b5fd04d886eed64b2cf7abf Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Thu, 25 Jul 2013 14:23:07 +0200 Subject: [PATCH] block: discard vfat labels with only spaces --- libblkid-tiny/vfat.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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); } -- 2.25.1