diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2009-03-08 11:38:22 +0100 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2009-03-08 11:38:22 +0100 |
commit | fe6d53b30c20e57a371e3fbb8675ccdd91e629d8 (patch) | |
tree | 7d62b3e4a21687ecdd95c65bf7d5786466f8d005 | |
parent | c059f209d8bcffc3432ac67ea9217820de799e21 (diff) | |
download | connman-fe6d53b30c20e57a371e3fbb8675ccdd91e629d8.tar.gz connman-fe6d53b30c20e57a371e3fbb8675ccdd91e629d8.tar.bz2 connman-fe6d53b30c20e57a371e3fbb8675ccdd91e629d8.zip |
Fix issue with network identifier lookup
-rw-r--r-- | src/device.c | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/src/device.c b/src/device.c index 687cea0c..c107757a 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); } /** |