summaryrefslogtreecommitdiffstats
path: root/src/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/util.c b/src/util.c
index b6d4e14..caedd89 100644
--- a/src/util.c
+++ b/src/util.c
@@ -164,12 +164,13 @@ const char* escape_essid(const char *s) {
for (i = s, o = output; i-s < IW_ESSID_MAX_SIZE && *i; i++) {
- if (*i >= 32 && *i < 126 && *i != '/' && *i != '%') {
+ if (*i >= 32 && *i < 126 && *i != '/' && *i != '%')
+ *(o++) = *i;
+ else {
*(o++) = '%';
*(o++) = hextab[*i >> 4];
*(o++) = hextab[*i & 0xF];
- } else
- *(o++) = *i;
+ }
}
*(o++) = 0;