From d8ed9e038c4fe9399698c629a848069eda5df057 Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Thu, 13 Feb 2020 21:28:37 +0000 Subject: [PATCH] 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 --- libfdisk/src/gpt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 -- 2.47.3