From: Karel Zak Date: Thu, 16 Mar 2017 09:01:54 +0000 (+0100) Subject: libfdisk: fix compiler warning [-Wsign-compare] X-Git-Tag: v2.30-rc1~180 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bb6762035a088583cb8c0cc87386da6f8a5958cb;p=thirdparty%2Futil-linux.git libfdisk: fix compiler warning [-Wsign-compare] Signed-off-by: Karel Zak --- diff --git a/libfdisk/src/gpt.c b/libfdisk/src/gpt.c index 6962e7702e..c99b16f12f 100644 --- a/libfdisk/src/gpt.c +++ b/libfdisk/src/gpt.c @@ -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;