mirror of git://git.sysmocom.de/ofono
sap: fix sap modem remove
prefix NULL means that the modem needs to be removed
This commit is contained in:
parent
e73244a4a3
commit
1f774bc1de
|
@ -234,13 +234,13 @@ static void bluetooth_sap_remove(const char *prefix)
|
||||||
|
|
||||||
DBG("%s", prefix);
|
DBG("%s", prefix);
|
||||||
|
|
||||||
if (modem_hash == NULL || prefix == NULL)
|
if (modem_hash == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
g_hash_table_iter_init(&iter, modem_hash);
|
g_hash_table_iter_init(&iter, modem_hash);
|
||||||
|
|
||||||
while (g_hash_table_iter_next(&iter, &key, &value)) {
|
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;
|
continue;
|
||||||
|
|
||||||
g_hash_table_iter_remove(&iter);
|
g_hash_table_iter_remove(&iter);
|
||||||
|
|
Loading…
Reference in New Issue