فهرست منبع

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

Fixes https://github.com/libsdl-org/SDL/issues/9071
Sam Lantinga 1 سال پیش
والد
کامیت
c1da39a245
1فایلهای تغییر یافته به همراه4 افزوده شده و 3 حذف شده
  1. 4 3
      src/joystick/SDL_gamepad.c

+ 4 - 3
src/joystick/SDL_gamepad.c

@@ -3750,10 +3750,11 @@ const char *SDL_GetGamepadAppleSFSymbolsNameForButton(SDL_Gamepad *gamepad, SDL_
     }
     SDL_UnlockJoysticks();
 
-    return retval;
-#else
-    return NULL;
+    if (retval && *retval) {
+        return retval;
+    }
 #endif
+    return NULL;
 }
 
 const char *SDL_GetGamepadAppleSFSymbolsNameForAxis(SDL_Gamepad *gamepad, SDL_GamepadAxis axis)