aboutsummaryrefslogtreecommitdiff
path: root/xcursor
diff options
context:
space:
mode:
authorLukas Märdian <slyon@ubuntu.com>2021-03-03 11:37:36 +0100
committerSimon Ser <contact@emersion.fr>2021-03-08 12:03:48 +0100
commitd8a422575bcb4bedd533e068aed6876a7291d8ca (patch)
tree7e76601b9f02bb05f508b87cd588119177632351 /xcursor
parent46d2f80c381d02e6caf5cde1f91db39da2f50579 (diff)
Fix false positive -Wstringop-truncation
Fix false positive stringop-truncation warning/error with GCC 10 on s390x by indicating GCC to explicitly ignore this case, as it is clearly a false positive (NUL is set in the following line). This allow the compilation to succeed with -Werror on. Fixes: https://github.com/swaywm/wlroots/issues/2018
Diffstat (limited to 'xcursor')
-rw-r--r--xcursor/xcursor.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/xcursor/xcursor.c b/xcursor/xcursor.c
index 51ce8323..d33dee28 100644
--- a/xcursor/xcursor.c
+++ b/xcursor/xcursor.c
@@ -655,8 +655,11 @@ _XcursorAddPathElt (char *path, const char *elt, int len)
elt++;
len--;
}
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wstringop-truncation"
strncpy (path + pathlen, elt, len);
path[pathlen + len] = '\0';
+#pragma GCC diagnostic pop
}
static char *