mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-10-29 05:40:12 -04:00
xcursor: use memcpy() to append string of known size
Since len <= strlen(elt) is known, we don't need a str*() function. Let's simply do memcpy() to suppress linter false positive. Fixes #2777.
This commit is contained in:
parent
a71d565138
commit
3c5cc02b18
1 changed files with 1 additions and 4 deletions
|
|
@ -655,11 +655,8 @@ _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);
|
||||
memcpy (path + pathlen, elt, len);
|
||||
path[pathlen + len] = '\0';
|
||||
#pragma GCC diagnostic pop
|
||||
}
|
||||
|
||||
static char *
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue