From a0f99ce23943d691636a6a27d647ca42a85fcd24 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 31 Mar 2009 18:35:37 -0700 Subject: [PATCH] Use common helper to encode object name --- src/network.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/network.c b/src/network.c index a83b921..754380d 100644 --- a/src/network.c +++ b/src/network.c @@ -456,7 +456,6 @@ struct connman_network *connman_network_create(const char *identifier, connman_uint8_t strength = 0; const char *str; char *temp; - unsigned int i; DBG("identifier %s type %d", identifier, type); @@ -468,19 +467,12 @@ struct connman_network *connman_network_create(const char *identifier, __connman_element_initialize(&network->element); - temp = g_strdup(identifier); + temp = connman_dbus_encode_string(identifier); if (temp == NULL) { g_free(network); 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->element.name = temp; network->element.type = CONNMAN_ELEMENT_TYPE_NETWORK; -- 2.7.4