From 7dffe9339bf8a92a556098d86712c4c38ac95226 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20M=C3=A4rdian?= Date: Thu, 4 Mar 2021 13:24:10 +0100 Subject: [PATCH] xcursor: use strncat instead of strncpy strncat appends '\0' automatically and avoids the stringop-truncation warning/error --- xcursor/xcursor.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/xcursor/xcursor.c b/xcursor/xcursor.c index d33dee28..acb2e1a8 100644 --- a/xcursor/xcursor.c +++ b/xcursor/xcursor.c @@ -655,11 +655,7 @@ _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 + strncat (path + pathlen, elt, len); } static char *