static boolean SDLOpenJoystick(int nr)
{
- if (nr < 0 || nr > MAX_PLAYERS)
+ if (nr < 0 || nr >= MAX_PLAYERS)
return FALSE;
#if defined(TARGET_SDL2)
static void SDLCloseJoystick(int nr)
{
- if (nr < 0 || nr > MAX_PLAYERS)
+ if (nr < 0 || nr >= MAX_PLAYERS)
return;
#if 1
boolean SDLCheckJoystickOpened(int nr)
{
- if (nr < 0 || nr > MAX_PLAYERS)
+ if (nr < 0 || nr >= MAX_PLAYERS)
return FALSE;
#if defined(TARGET_SDL2)
int axis_id = axis_id_raw % 2;
#endif
+ if (nr < 0 || nr >= MAX_PLAYERS)
+ return;
+
if (axis_id == -1)
return;
int button_id = button_id_raw % 2;
#endif
+ if (nr < 0 || nr >= MAX_PLAYERS)
+ return;
+
if (button_id == -1)
return;