Pointer as bool (libsdl-org#7214)

This commit is contained in:
Sylvain
2023-11-09 22:29:15 +01:00
committed by Sam Lantinga
parent 23db971681
commit d8600f717e
371 changed files with 2448 additions and 2442 deletions

View File

@@ -2658,7 +2658,7 @@ SDL_GamepadType GetMappingType(const char *mapping)
char *SetMappingType(char *mapping, SDL_GamepadType type)
{
const char *type_string = SDL_GetGamepadStringForType(type);
if (type_string == NULL || type == SDL_GAMEPAD_TYPE_UNKNOWN) {
if (!type_string || type == SDL_GAMEPAD_TYPE_UNKNOWN) {
return RemoveMappingValue(mapping, "type");
} else {
return SetMappingValue(mapping, "type", type_string);