From 29265d0738a0aa9752053e4525293cbf4210e1be Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 7 Aug 2022 18:49:30 -0700 Subject: [PATCH] Use SDL_GetStringBoolean() to parse the hint value --- src/joystick/SDL_joystick.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/joystick/SDL_joystick.c b/src/joystick/SDL_joystick.c index 78ac09609..891552711 100644 --- a/src/joystick/SDL_joystick.c +++ b/src/joystick/SDL_joystick.c @@ -216,7 +216,7 @@ SDL_SetJoystickIDForPlayerIndex(int player_index, SDL_JoystickID instance_id) static void SDLCALL SDL_JoystickAllowBackgroundEventsChanged(void *userdata, const char *name, const char *oldValue, const char *hint) { - if (hint && *hint == '1') { + if (SDL_GetStringBoolean(hint, SDL_FALSE)) { SDL_joystick_allows_background_events = SDL_TRUE; } else { SDL_joystick_allows_background_events = SDL_FALSE;