Linux: Include the null byte in joystick path

This potential bug was found thanks to gcc 8’s -Wstringop-truncation
warning.
master
Emmanuel Gil Peyrot ago%!(EXTRA string=7 years) committed by linkmauve
parent dcd2a19d90
commit e75af5f531
  1. 2
      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);

Loading…
Cancel
Save