]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libfdisk: fix compiler warning [-Wsign-compare]
authorKarel Zak <kzak@redhat.com>
Thu, 16 Mar 2017 09:01:54 +0000 (10:01 +0100)
committerKarel Zak <kzak@redhat.com>
Thu, 16 Mar 2017 09:01:54 +0000 (10:01 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
libfdisk/src/gpt.c

index 6962e7702e5e61532e177dd8e3b2d04e384b44d6..c99b16f12f78ecb279e5f3d24fb2b995586aac47 100644 (file)
@@ -830,7 +830,7 @@ static struct gpt_entry *gpt_read_entries(struct fdisk_context *cxt,
        sz = (ssize_t) le32_to_cpu(header->npartition_entries) *
             le32_to_cpu(header->sizeof_partition_entry);
 
-       if (sz == 0 || sz >= UINT32_MAX ||
+       if (sz == 0 || sz >= (ssize_t) UINT32_MAX ||
            le32_to_cpu(header->sizeof_partition_entry) != sizeof(struct gpt_entry)) {
                DBG(LABEL, ul_debug("GPT entreis array size check failed"));
                return NULL;