diff --git a/src/linux_joystick.c b/src/linux_joystick.c index 2777d0b3..baa3651b 100644 --- a/src/linux_joystick.c +++ b/src/linux_joystick.c @@ -228,7 +228,7 @@ static GLFWbool openJoystickDevice(const char* path) 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);