xcursor: use strncat instead of strncpy

strncat appends '\0' automatically and avoids the stringop-truncation
warning/error
This commit is contained in:
Lukas Märdian 2021-03-04 13:24:10 +01:00 committed by Simon Ser
parent d8a422575b
commit 7dffe9339b

View file

@ -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 *