mirror of
https://github.com/raysan5/raylib.git
synced 2025-10-03 16:36:26 +00:00
Small security tweaks
This commit is contained in:
@@ -1374,7 +1374,7 @@ static void InitEvdevInput(void)
|
|||||||
if ((strncmp("event", entity->d_name, strlen("event")) == 0) || // Search for devices named "event*"
|
if ((strncmp("event", entity->d_name, strlen("event")) == 0) || // Search for devices named "event*"
|
||||||
(strncmp("mouse", entity->d_name, strlen("mouse")) == 0)) // Search for devices named "mouse*"
|
(strncmp("mouse", entity->d_name, strlen("mouse")) == 0)) // Search for devices named "mouse*"
|
||||||
{
|
{
|
||||||
sprintf(path, "%s%s", DEFAULT_EVDEV_PATH, entity->d_name);
|
snprintf(path, MAX_FILEPATH_LENGTH, "%s%s", DEFAULT_EVDEV_PATH, entity->d_name);
|
||||||
ConfigureEvdevDevice(path); // Configure the device if appropriate
|
ConfigureEvdevDevice(path); // Configure the device if appropriate
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1746,7 +1746,7 @@ static EM_BOOL EmscriptenGamepadCallback(int eventType, const EmscriptenGamepadE
|
|||||||
if (gamepadEvent->connected && (gamepadEvent->index < MAX_GAMEPADS))
|
if (gamepadEvent->connected && (gamepadEvent->index < MAX_GAMEPADS))
|
||||||
{
|
{
|
||||||
CORE.Input.Gamepad.ready[gamepadEvent->index] = true;
|
CORE.Input.Gamepad.ready[gamepadEvent->index] = true;
|
||||||
sprintf(CORE.Input.Gamepad.name[gamepadEvent->index], "%s", gamepadEvent->id);
|
snprintf(CORE.Input.Gamepad.name[gamepadEvent->index], MAX_GAMEPAD_NAME_LENGTH, "%s", gamepadEvent->id);
|
||||||
}
|
}
|
||||||
else CORE.Input.Gamepad.ready[gamepadEvent->index] = false;
|
else CORE.Input.Gamepad.ready[gamepadEvent->index] = false;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user