From: Antoine Pitrou Date: Sat, 9 Oct 2010 15:24:28 +0000 (+0000) Subject: Issue #10055: Make json C89-compliant in UCS4 mode. X-Git-Tag: v3.2a3~8 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5b0e9e84e9833337f791d5bc74f823a16681924b;p=python Issue #10055: Make json C89-compliant in UCS4 mode. --- diff --git a/Misc/NEWS b/Misc/NEWS index ac731c56b0..94f0d8680f 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -346,6 +346,8 @@ Tests Build ----- +- Issue #10055: Make json C89-compliant in UCS4 mode. + - Issue #9552: Avoid unnecessary rebuild of OpenSSL. (Windows) - Issue #1633863: Don't ignore $CC under AIX. diff --git a/Modules/_json.c b/Modules/_json.c index bbaf7dd4a7..dd9749bc68 100644 --- a/Modules/_json.c +++ b/Modules/_json.c @@ -440,8 +440,8 @@ scanstring_unicode(PyObject *pystr, Py_ssize_t end, int strict, Py_ssize_t *next end += 6; /* Decode 4 hex digits */ for (; next < end; next++) { - c2 <<= 4; Py_UNICODE digit = buf[next]; + c2 <<= 4; switch (digit) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9':