Skip to content

Commit

Permalink
fix SDL_FindFreePlayerIndex so it can really return -1.
Browse files Browse the repository at this point in the history
  • Loading branch information
sezero committed Mar 8, 2023
1 parent 91b328c commit 53bde3a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/joystick/SDL_joystick.c
Expand Up @@ -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();

Expand All @@ -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)
Expand Down

0 comments on commit 53bde3a

Please sign in to comment.