mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-12-23 02:19:49 +01:00
examples/screencopy-dmabuf: call strncpy with maxlen - 1
The original code wasn't wrong since we were manually writing a null byte anyway, but this makes GCC happy. Closes: https://github.com/swaywm/wlroots/issues/2273
This commit is contained in:
parent
7f9bbaaa17
commit
4615ce9099
1 changed files with 1 additions and 1 deletions
|
@ -87,7 +87,7 @@ static bool find_render_node(char *node, size_t maxlen) {
|
|||
continue;
|
||||
}
|
||||
|
||||
strncpy(node, dev->nodes[DRM_NODE_RENDER], maxlen);
|
||||
strncpy(node, dev->nodes[DRM_NODE_RENDER], maxlen - 1);
|
||||
node[maxlen - 1] = '\0';
|
||||
r = true;
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue