mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-25 22:25:58 +01: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…
Reference in a new issue