From: Serhiy Storchaka Date: Sat, 4 Oct 2014 11:51:44 +0000 (+0300) Subject: Fixed compilation error introduced in 3f7519f633ed (issue #22518). X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fb7c38040e6ac57ec71e0fec634ce2f30de84c7f;p=python Fixed compilation error introduced in 3f7519f633ed (issue #22518). --- diff --git a/Python/codecs.c b/Python/codecs.c index 8b8c037e93..a901d6de03 100644 --- a/Python/codecs.c +++ b/Python/codecs.c @@ -569,8 +569,7 @@ PyObject *PyCodec_XMLCharRefReplaceErrors(PyObject *exc) if (end - start > PY_SSIZE_T_MAX / (2+7+1)) { end = start + PY_SSIZE_T_MAX / (2+7+1); #ifndef Py_UNICODE_WIDE - ch = startp[end - 1]; - if (0xD800 <= ch && ch <= 0xDBFF) + if (0xD800 <= startp[end - 1] && startp[end - 1] <= 0xDBFF) end--; #endif }