From b9d98331c59f6d88818cb777368d0b6565aaefa3 Mon Sep 17 00:00:00 2001 From: Ozkan Sezer Date: Sun, 9 Jan 2022 20:33:32 +0300 Subject: [PATCH] os2joystick: fix uninitialized use of local var 'maxdevs' --- src/joystick/os2/SDL_os2joystick.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/joystick/os2/SDL_os2joystick.c b/src/joystick/os2/SDL_os2joystick.c index 5d39df849..00b7fc554 100644 --- a/src/joystick/os2/SDL_os2joystick.c +++ b/src/joystick/os2/SDL_os2joystick.c @@ -184,6 +184,7 @@ static int OS2_JoystickInit(void) joyPortClose(&hJoyPort); return SDL_SetError("Could not read joystick port."); } + maxdevs = 0; if (stGameParms.useA != 0) maxdevs++; if (stGameParms.useB != 0) maxdevs++; if (maxdevs > MAX_JOYSTICKS) maxdevs = MAX_JOYSTICKS;