]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libblkid: fix compiler warning [-Wsign-compare]
authorKarel Zak <kzak@redhat.com>
Tue, 25 Feb 2020 11:06:06 +0000 (12:06 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 25 Feb 2020 11:06:06 +0000 (12:06 +0100)
libblkid/src/superblocks/exfat.c: In function ‘probe_exfat’:
./include/c.h:133:17: warning: comparison of distinct pointer types lacks a cast
libblkid/src/superblocks/exfat.c:129:5: note: in expansion of macro ‘min’
./include/c.h:134:8: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Wsign-compare]

Signed-off-by: Karel Zak <kzak@redhat.com>
libblkid/src/superblocks/exfat.c

index ca7d6c813abb810fc103b3f5997a533c0964eaee..f586ec78651a6191847999c3a75a4660de23306b 100644 (file)
@@ -126,7 +126,7 @@ static int probe_exfat(blkid_probe pr, const struct blkid_idmag *mag)
        label = find_label(pr, sb);
        if (label)
                blkid_probe_set_utf8label(pr, label->name,
-                               min(label->length * 2, sizeof(label->name)),
+                               min((size_t) label->length * 2, sizeof(label->name)),
                                UL_ENCODE_UTF16LE);
        else if (errno)
                return -errno;