Commit 35c13196f0104d23a4ed2f3f32e13854e0eda0de

Sam Lantinga 2023-03-08T08:40:38

Fixed uninitialized variable

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/joystick/SDL_joystick.c b/src/joystick/SDL_joystick.c
index aad453a..0a74be1 100644
--- a/src/joystick/SDL_joystick.c
+++ b/src/joystick/SDL_joystick.c
@@ -202,7 +202,7 @@ static SDL_bool SDL_GetDriverAndJoystickIndex(int device_index, SDL_JoystickDriv
 
 static int SDL_FindFreePlayerIndex()
 {
-    int player_index;
+    int player_index = -1;
 
     SDL_AssertJoysticksLocked();