aboutsummaryrefslogtreecommitdiffstats
path: root/json_tokener.c
diff options
context:
space:
mode:
Diffstat (limited to 'json_tokener.c')
-rw-r--r--json_tokener.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/json_tokener.c b/json_tokener.c
index 9a76293..60e81f2 100644
--- a/json_tokener.c
+++ b/json_tokener.c
@@ -23,7 +23,6 @@
#include <string.h>
#include <limits.h>
-#include "bits.h"
#include "debug.h"
#include "printbuf.h"
#include "arraylist.h"
@@ -36,6 +35,8 @@
#include <locale.h>
#endif /* HAVE_LOCALE_H */
+#define jt_hexdigit(x) (((x) <= '9') ? (x) - '0' : ((x) & 7) + 9)
+
#if !HAVE_STRDUP && defined(_MSC_VER)
/* MSC has the version as _strdup */
# define strdup _strdup
@@ -536,7 +537,7 @@ struct json_object* json_tokener_parse_ex(struct json_tokener *tok,
/* Handle a 4-byte sequence, or two sequences if a surrogate pair */
while(1) {
if(strchr(json_hex_chars, c)) {
- tok->ucs_char += ((unsigned int)hexdigit(c) << ((3-tok->st_pos++)*4));
+ tok->ucs_char += ((unsigned int)jt_hexdigit(c) << ((3-tok->st_pos++)*4));
if(tok->st_pos == 4) {
unsigned char unescaped_utf[4];