diff options
Diffstat (limited to 'src/daemon/internal.c')
-rw-r--r-- | src/daemon/internal.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/daemon/internal.c b/src/daemon/internal.c index 16b39df0..3b0a5441 100644 --- a/src/daemon/internal.c +++ b/src/daemon/internal.c | |||
@@ -121,7 +121,9 @@ MHD_http_unescape (void *cls, | |||
121 | { | 121 | { |
122 | char *rpos = val; | 122 | char *rpos = val; |
123 | char *wpos = val; | 123 | char *wpos = val; |
124 | char *end; | ||
124 | unsigned int num; | 125 | unsigned int num; |
126 | char buf3[3]; | ||
125 | 127 | ||
126 | while ('\0' != *rpos) | 128 | while ('\0' != *rpos) |
127 | { | 129 | { |
@@ -133,10 +135,11 @@ MHD_http_unescape (void *cls, | |||
133 | rpos++; | 135 | rpos++; |
134 | break; | 136 | break; |
135 | case '%': | 137 | case '%': |
136 | if ( (1 == SSCANF (&rpos[1], | 138 | buf3[0] = rpos[1]; |
137 | "%2x", &num)) || | 139 | buf3[1] = rpos[2]; |
138 | (1 == SSCANF (&rpos[1], | 140 | buf3[2] = '\0'; |
139 | "%2X", &num)) ) | 141 | num = strtoul (buf3, &end, 16); |
142 | if ('\0' == *end) | ||
140 | { | 143 | { |
141 | *wpos = (unsigned char) num; | 144 | *wpos = (unsigned char) num; |
142 | wpos++; | 145 | wpos++; |