From: Marcel Holtmann Date: Sun, 8 Mar 2009 10:38:22 +0000 (+0100) Subject: Fix issue with network identifier lookup X-Git-Tag: accepted/2.0alpha-wayland/20121110.002834~4020 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fe6d53b30c20e57a371e3fbb8675ccdd91e629d8;p=profile%2Fivi%2Fconnman.git Fix issue with network identifier lookup --- diff --git a/src/device.c b/src/device.c index 687cea0..c107757 100644 --- a/src/device.c +++ b/src/device.c @@ -1451,28 +1451,9 @@ int connman_device_add_network(struct connman_device *device, struct connman_network *connman_device_get_network(struct connman_device *device, const char *identifier) { - struct connman_network *network; - char *temp; - unsigned int i; - DBG("device %p identifier %s", device, identifier); - temp = g_strdup(identifier); - if (temp == NULL) - return NULL; - - for (i = 0; i < strlen(temp); i++) { - char tmp = temp[i]; - if ((tmp < '0' || tmp > '9') && (tmp < 'A' || tmp > 'Z') && - (tmp < 'a' || tmp > 'z')) - temp[i] = '_'; - } - - network = g_hash_table_lookup(device->networks, temp); - - g_free(temp); - - return network; + return g_hash_table_lookup(device->networks, identifier); } /**