The g_strcmp0 does the NULL pointer checking already
authorMarcel Holtmann <marcel@holtmann.org>
Tue, 7 Jul 2009 07:22:00 +0000 (00:22 -0700)
committerMarcel Holtmann <marcel@holtmann.org>
Tue, 7 Jul 2009 07:22:00 +0000 (00:22 -0700)
src/device.c

index 4b71287..aa53304 100644 (file)
@@ -512,14 +512,13 @@ static struct connman_network *find_network(struct connman_device *device,
                if (tmp_ssid && memcmp(ssid, tmp_ssid, tmp_ssid_size))
                        continue;
 
-               if (security && tmp_security &&
-                               g_strcmp0(security, tmp_security))
+               if (g_strcmp0(security, tmp_security) != 0)
                        continue;
 
-               if (mode && tmp_mode && g_strcmp0(mode, tmp_mode))
+               if (g_strcmp0(mode, tmp_mode) != 0)
                        continue;
 
-               if (address && tmp_address && g_strcmp0(address, tmp_address))
+               if (g_strcmp0(address, tmp_address) != 0)
                        continue;
 
                return connman_network_ref(value);