summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2017-05-30 14:32:16 +0200
committerThomas Haller <thaller@redhat.com>2017-05-30 14:33:23 +0200
commit3443f250018e7721e4af91ce7918bdb81048643b (patch)
treeb68ab1f4f45542dadc1ddde3816476bbbd02d988
parent1fcbb69ae22ed4a6047e36c816f49b2a67a13583 (diff)
downloadNetworkManager-3443f250018e7721e4af91ce7918bdb81048643b.tar.gz
tui: use nm_streq0() in nmt_connect_connection_list_get_connection()
-rw-r--r--clients/tui/nmt-connect-connection-list.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/clients/tui/nmt-connect-connection-list.c b/clients/tui/nmt-connect-connection-list.c
index 0011fc5f38..862861292d 100644
--- a/clients/tui/nmt-connect-connection-list.c
+++ b/clients/tui/nmt-connect-connection-list.c
@@ -621,7 +621,6 @@ nmt_connect_connection_list_get_connection (NmtConnectConnectionList *list,
NmtConnectDevice *nmtdev;
NmtConnectConnection *nmtconn = NULL;
NMConnection *conn = NULL;
- const char *iface = NULL;
g_return_val_if_fail (identifier, FALSE);
@@ -640,22 +639,21 @@ nmt_connect_connection_list_get_connection (NmtConnectConnectionList *list,
if (conn) {
if (conn == nmtconn->conn)
goto found;
- } else if (nmtconn->ssid && !strcmp (identifier, nmtconn->ssid))
+ } else if (nm_streq0 (identifier, nmtconn->ssid))
goto found;
}
- if (!conn && nmtdev->device) {
- iface = nm_device_get_ip_iface (nmtdev->device);
- if (iface && !strcmp (identifier, iface)) {
- nmtconn = nmtdev->conns->data;
- goto found;
- }
+ if ( !conn
+ && nmtdev->device
+ && nm_streq0 (identifier, nm_device_get_ip_iface (nmtdev->device))) {
+ nmtconn = nmtdev->conns->data;
+ goto found;
}
}
return FALSE;
- found:
+found:
if (connection)
*connection = nmtconn->conn;
if (device)