diff --git a/glfw/linux_joystick.c b/glfw/linux_joystick.c index 2777d0b38..db5a0e7a0 100644 --- a/glfw/linux_joystick.c +++ b/glfw/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); @@ -431,4 +431,3 @@ int _glfwPlatformPollJoystick(_GLFWjoystick* js, int mode) void _glfwPlatformUpdateGamepadGUID(char* guid) { } -