瀏覽代碼

os2joystick: fix uninitialized use of local var 'maxdevs'

Ozkan Sezer 3 年之前
父節點
當前提交
b9d98331c5
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      src/joystick/os2/SDL_os2joystick.c

+ 1 - 0
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;