]> 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>
Fri, 15 May 2020 10:50:32 +0000 (12:50 +0200)
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 62fb8ce0b86f6fed4b735b6cb87f1b1ecf8d6927..41028270bac34608f4b3ccc970853ec7cba3487c 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)),
                                BLKID_ENC_UTF16LE);
        else if (errno)
                return -errno;