summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2016-08-12 08:18:27 (GMT)
committer Michael Drake <tlsa@netsurf-browser.org>2016-08-13 11:05:55 (GMT)
commita1668f6c1e0c9e88f62f6082c6206c4d33f25cce (patch)
treecc82ea197acf4041fb02335ad1b67f0b5058f8ed
parentefeeacca8621076f285ead0fc7e95d61938daea6 (diff)
downloadnetsurf-a1668f6c1e0c9e88f62f6082c6206c4d33f25cce.tar.gz
netsurf-a1668f6c1e0c9e88f62f6082c6206c4d33f25cce.tar.bz2
url: Use ascii module, rather than ctype for locale safetly.
-rw-r--r--utils/url.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/utils/url.c b/utils/url.c
index 7a7b7a1..ee84850 100644
--- a/utils/url.c
+++ b/utils/url.c
@@ -35,7 +35,9 @@
#include <assert.h>
#include <string.h>
#include <stdlib.h>
+#include <stdbool.h>
+#include "utils/ascii.h"
#include "utils/config.h"
#include "utils/log.h"
#include "utils/url.h"
@@ -92,7 +94,7 @@ nserror url_unescape(const char *str, size_t length,
char c1 = *(str + 1);
char c2 = *(str + 2);
- if (c == '%' && isxdigit(c1) && isxdigit(c2)) {
+ if (c == '%' && ascii_is_hex(c1) && ascii_is_hex(c2)) {
c = xdigit_to_hex(c1) << 4 | xdigit_to_hex(c2);
str += 2;
}