From a2f39399a1afa16f4eeed0b48a46203dfc3bf2a3 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 3 Mar 2024 11:56:29 -0800 Subject: [PATCH] SDL_GameControllerGetAppleSFSymbolsNameForAxis() returns NULL if the symbol isn't found (cherry picked from commit 627e15871a1c48441e423fe1b6c3d8098ac9c3c8) --- src/joystick/SDL_gamecontroller.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/joystick/SDL_gamecontroller.c b/src/joystick/SDL_gamecontroller.c index 0e2dbe14e2..bbb7f7994d 100644 --- a/src/joystick/SDL_gamecontroller.c +++ b/src/joystick/SDL_gamecontroller.c @@ -3280,10 +3280,11 @@ const char *SDL_GameControllerGetAppleSFSymbolsNameForAxis(SDL_GameController *g } SDL_UnlockJoysticks(); - return retval; -#else - return NULL; + if (retval && *retval) { + return retval; + } #endif + return NULL; } /* vi: set ts=4 sw=4 expandtab: */