mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-23 08:47:47 +02:00
Linux: Include the null byte in joystick path
This potential bug was found thanks to gcc 8’s -Wstringop-truncation warning.
This commit is contained in:
3
glfw/linux_joystick.c
vendored
3
glfw/linux_joystick.c
vendored
@@ -228,7 +228,7 @@ static GLFWbool openJoystickDevice(const char* path)
|
|||||||
return GLFW_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
strncpy(linjs.path, path, sizeof(linjs.path));
|
strncpy(linjs.path, path, sizeof(linjs.path) - 1);
|
||||||
memcpy(&js->linjs, &linjs, sizeof(linjs));
|
memcpy(&js->linjs, &linjs, sizeof(linjs));
|
||||||
|
|
||||||
pollAbsState(js);
|
pollAbsState(js);
|
||||||
@@ -431,4 +431,3 @@ int _glfwPlatformPollJoystick(_GLFWjoystick* js, int mode)
|
|||||||
void _glfwPlatformUpdateGamepadGUID(char* guid)
|
void _glfwPlatformUpdateGamepadGUID(char* guid)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user