From 53bde3abee6bc64c3f5368c37e1b685ac18aafb3 Mon Sep 17 00:00:00 2001 From: Ozkan Sezer Date: Wed, 8 Mar 2023 20:00:00 +0300 Subject: [PATCH] fix SDL_FindFreePlayerIndex so it can really return -1. --- src/joystick/SDL_joystick.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/joystick/SDL_joystick.c b/src/joystick/SDL_joystick.c index d4096022aa..49ff934327 100644 --- a/src/joystick/SDL_joystick.c +++ b/src/joystick/SDL_joystick.c @@ -198,7 +198,7 @@ static SDL_bool SDL_GetDriverAndJoystickIndex(SDL_JoystickID instance_id, SDL_Jo static int SDL_FindFreePlayerIndex(void) { - int player_index = -1; + int player_index; SDL_AssertJoysticksLocked(); @@ -207,7 +207,7 @@ static int SDL_FindFreePlayerIndex(void) return player_index; } } - return player_index; + return -1; } static int SDL_GetPlayerIndexForJoystickID(SDL_JoystickID instance_id)