Optimize SSID character replacement
authorMarcel Holtmann <marcel@holtmann.org>
Tue, 2 Dec 2008 23:22:27 +0000 (00:22 +0100)
committerMarcel Holtmann <marcel@holtmann.org>
Tue, 2 Dec 2008 23:22:27 +0000 (00:22 +0100)
plugins/wifi.c

index 87ad8cc..494f53b 100644 (file)
@@ -182,9 +182,9 @@ static void scan_result(struct connman_element *parent,
        for (i = 0; i < strlen(temp); i++) {
                if (temp[i] == ' ' || temp[i] == '.' || temp[i] == '-')
                        temp[i] = '_';
-               if (temp[i] == '(' || temp[i] == ')')
+               else if (temp[i] == '(' || temp[i] == ')')
                        temp[i] = '_';
-               if (g_ascii_isprint(temp[i]) == FALSE)
+               else if (g_ascii_isprint(temp[i]) == FALSE)
                        temp[i] = '_';
                temp[i] = g_ascii_tolower(temp[i]);
        }