commit | e75af5f531c0ddabffbc7f028296b18fd98ee036 | [log] [tgz] |
---|---|---|
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | Wed Oct 03 20:49:07 2018 +0200 |
committer | linkmauve <linkmauve@linkmauve.fr> | Wed Oct 03 22:03:20 2018 +0200 |
tree | 7d50a07b0e775509088596f2c5ab18da3fc86dc0 | |
parent | dcd2a19d9096b83c66352c620357bec2058b7c9d [diff] |
Linux: Include the null byte in joystick path This potential bug was found thanks to gcc 8’s -Wstringop-truncation warning.
diff --git a/src/linux_joystick.c b/src/linux_joystick.c index 2777d0b..baa3651 100644 --- a/src/linux_joystick.c +++ b/src/linux_joystick.c
@@ -228,7 +228,7 @@ return GLFW_FALSE; } - strncpy(linjs.path, path, sizeof(linjs.path)); + strncpy(linjs.path, path, sizeof(linjs.path) - 1); memcpy(&js->linjs, &linjs, sizeof(linjs)); pollAbsState(js);