summaryrefslogtreecommitdiff
path: root/json.c
diff options
context:
space:
mode:
authorJoey Adams2011-01-17 19:17:29 +0000
committerJoey Adams2011-01-17 19:17:29 +0000
commit59ad85e9165616e5de89b12465852ccf092f2e47 (patch)
tree999456033e9cd9cd227a860d32fc052e90f1814a /json.c
parent4869261b8a1ea6186b5d0c06d97c4296a2ce7bcf (diff)
Fixed UTF-16 surrogate pair calculation to properly handle cases like "\uD840\uDC00".
Diffstat (limited to 'json.c')
-rw-r--r--json.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/json.c b/json.c
index 3aa6ddd..ade2136 100644
--- a/json.c
+++ b/json.c
@@ -824,7 +824,7 @@ json_decode_string(const char **sp, size_t *length, bool strict)
s += 6;
- uc = 0x10000 | ((uc & 0x3FF) << 10) | (lc & 0x3FF);
+ uc = 0x10000 + (((uc & 0x3FF) << 10) | (lc & 0x3FF));
}
unicode_to_utf8(uc, (unsigned char *) buf);