Fix g_strsplit result check 22/220822/1
authorSlava Barinov <v.barinov@samsung.com>
Mon, 23 Dec 2019 11:02:41 +0000 (14:02 +0300)
committerSlava Barinov <v.barinov@samsung.com>
Mon, 23 Dec 2019 11:07:19 +0000 (14:07 +0300)
bluetooth-frwk-0.3.0/bt-api/bt-common.c:1406:19: error: comparison between pointer and zero character constant [-Werror=pointer-compare]
1406 |   if (str_list[0] != '\0')
     |                   ^~

Change-Id: Ie1ace3bcb151477af7d60e9389bd44f1b5f802f9
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
bt-api/bt-common.c

index d329b6c..a4dbd38 100644 (file)
@@ -1403,7 +1403,7 @@ void _bt_print_api_caller_name(void)
 
        if (fgets(buf, 256, fp) != NULL) {
                str_list = g_strsplit(buf, " ", -1);
-               if (str_list[0] != '\0')
+               if (str_list[0] != NULL)
                        BT_INFO("Caller : %s", str_list[0]);
                g_strfreev(str_list);
        }
@@ -2507,4 +2507,3 @@ BT_EXPORT_API int bluetooth_unregister_callback(void)
 
        return BLUETOOTH_ERROR_NONE;
 }
-