From: Sami Kerola Date: Thu, 13 Feb 2020 21:28:37 +0000 (+0000) Subject: libfdisk: fix pointer wraparound warning X-Git-Tag: v2.36-rc1~225^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d8ed9e038c4fe9399698c629a848069eda5df057;p=thirdparty%2Futil-linux.git libfdisk: fix pointer wraparound warning libfdisk/src/gpt.c:1713:6: warning: assuming pointer wraparound does not occur when comparing P +- C1 with P +- C2 [-Wstrict-overflow] Signed-off-by: Sami Kerola --- diff --git a/libfdisk/src/gpt.c b/libfdisk/src/gpt.c index 79b95f710e..11bf9fefb7 100644 --- a/libfdisk/src/gpt.c +++ b/libfdisk/src/gpt.c @@ -1710,13 +1710,13 @@ static int gpt_entry_attrs_to_string(struct gpt_entry *e, char **res) p += l - 1; } if (isset(bits, GPT_ATTRBIT_NOBLOCK)) { - if (p > *res) + if (p != *res) *p++ = ' '; memcpy(p, GPT_ATTRSTR_NOBLOCK, (l = sizeof(GPT_ATTRSTR_NOBLOCK))); p += l - 1; } if (isset(bits, GPT_ATTRBIT_LEGACY)) { - if (p > *res) + if (p != *res) *p++ = ' '; memcpy(p, GPT_ATTRSTR_LEGACY, (l = sizeof(GPT_ATTRSTR_LEGACY))); p += l - 1; @@ -1728,7 +1728,7 @@ static int gpt_entry_attrs_to_string(struct gpt_entry *e, char **res) if (!isset(bits, n)) continue; if (!count) { - if (p > *res) + if (p != *res) *p++ = ' '; p += sprintf(p, "GUID:%u", n); } else