Explorar o código

SDL_GameControllerGetAppleSFSymbolsNameForAxis() returns NULL if the symbol isn't found

(cherry picked from commit 627e15871a1c48441e423fe1b6c3d8098ac9c3c8)
Sam Lantinga %!s(int64=2) %!d(string=hai) anos
pai
achega
a2f39399a1
Modificáronse 1 ficheiros con 4 adicións e 3 borrados
  1. 4 3
      src/joystick/SDL_gamecontroller.c

+ 4 - 3
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: */