From 54a1f61a17c73b55e05d5e6fc6ee19d88f3d0f64 Mon Sep 17 00:00:00 2001 From: Philipp Wiesemann Date: Wed, 25 Dec 2013 17:02:15 +0100 Subject: [PATCH] Changed return -1 after SDL_SetError() to return SDL_SetError(). --- src/joystick/SDL_gamecontroller.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/joystick/SDL_gamecontroller.c b/src/joystick/SDL_gamecontroller.c index 6aa80cb7e..abb78db3e 100644 --- a/src/joystick/SDL_gamecontroller.c +++ b/src/joystick/SDL_gamecontroller.c @@ -743,8 +743,7 @@ SDL_GameControllerAddMapping( const char *mappingString ) pchGUID = SDL_PrivateGetControllerGUIDFromMappingString( mappingString ); if (!pchGUID) { - SDL_SetError("Couldn't parse GUID from %s", mappingString); - return -1; + return SDL_SetError("Couldn't parse GUID from %s", mappingString); } #ifdef SDL_JOYSTICK_DINPUT if ( !SDL_strcasecmp( pchGUID, "xinput" ) ) { @@ -756,15 +755,13 @@ SDL_GameControllerAddMapping( const char *mappingString ) pchName = SDL_PrivateGetControllerNameFromMappingString( mappingString ); if (!pchName) { - SDL_SetError("Couldn't parse name from %s", mappingString); - return -1; + return SDL_SetError("Couldn't parse name from %s", mappingString); } pchMapping = SDL_PrivateGetControllerMappingFromMappingString( mappingString ); if (!pchMapping) { - SDL_SetError("Couldn't parse %s", mappingString); SDL_free( pchName ); - return -1; + return SDL_SetError("Couldn't parse %s", mappingString); } pControllerMapping = SDL_PrivateGetControllerMappingForGUID(&jGUID);