diff options
Diffstat (limited to 'Python/codecs.c')
-rw-r--r-- | Python/codecs.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Python/codecs.c b/Python/codecs.c index 8b8c037..a901d6d 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 } |