sap: fix sap modem remove
authorGustavo F. Padovan <gustavo@padovan.org>
Tue, 27 Sep 2011 21:04:20 +0000 (18:04 -0300)
committerDenis Kenzior <denkenz@gmail.com>
Wed, 28 Sep 2011 04:43:27 +0000 (23:43 -0500)
prefix NULL means that the modem needs to be removed

plugins/sap.c

index b679ce5..574031a 100644 (file)
@@ -234,13 +234,13 @@ static void bluetooth_sap_remove(const char *prefix)
 
        DBG("%s", prefix);
 
-       if (modem_hash == NULL || prefix == NULL)
+       if (modem_hash == NULL)
                return;
 
        g_hash_table_iter_init(&iter, modem_hash);
 
        while (g_hash_table_iter_next(&iter, &key, &value)) {
-               if (g_str_has_prefix((char *)key, prefix) == FALSE)
+               if (prefix && g_str_has_prefix((char *)key, prefix) == FALSE)
                        continue;
 
                g_hash_table_iter_remove(&iter);