BJoystick: Fix fJoystickInfo initialization.
joystick_info contains BLists which initialize themselves upon new(), and Clang warned (correctly) that using memset() overwites that, as well as RTTI and other data that they contain. So instead, only memset the first part of the struct, and then manually initialize the other members. Fixes #14217.
This commit is contained in:
parent
09c7b1526f
commit
9b83a2a043
@ -62,8 +62,11 @@ BJoystick::BJoystick()
|
||||
sLogFile = fopen("/var/log/joystick.log", "a");
|
||||
#endif
|
||||
|
||||
if (fJoystickInfo != NULL)
|
||||
memset(fJoystickInfo, 0, sizeof(joystick_info));
|
||||
if (fJoystickInfo != NULL) {
|
||||
memset(&fJoystickInfo->module_info, 0, sizeof(joystick_module_info));
|
||||
fJoystickInfo->calibration_enable = false;
|
||||
fJoystickInfo->max_latency = 0;
|
||||
}
|
||||
|
||||
RescanDevices();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user