[gnome-games/wip/aplazas/gamepad-event: 3/14] gamepad: Fix empty string test



commit 91fd301bcee78ac09a74c3180d7d10115ad206ae
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Fri May 12 21:53:08 2017 +0200

    gamepad: Fix empty string test
    
    Test if a string is empty instead of NULL as it was the intended test in
    games_gamepad_mapping_new_from_sdl_string().
    
    https://bugzilla.gnome.org/show_bug.cgi?id=782549

 src/gamepad/gamepad-mapping.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/gamepad/gamepad-mapping.c b/src/gamepad/gamepad-mapping.c
index 8e17bb6..500ef12 100644
--- a/src/gamepad/gamepad-mapping.c
+++ b/src/gamepad/gamepad-mapping.c
@@ -313,7 +313,7 @@ games_gamepad_mapping_new_from_sdl_string (const gchar  *mapping_string,
     return NULL;
   }
 
-  if (mapping_string == NULL) {
+  if (mapping_string[0] == '\0') {
     g_set_error_literal (error,
                          GAMES_GAMEPAD_MAPPING_ERROR,
                          GAMES_GAMEPAD_MAPPING_ERROR_NOT_A_MAPPING,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]