Commit ac3e04f5 authored by Serhiy Storchaka's avatar Serhiy Storchaka

Fixed compilation error introduced in 3f7519f633ed (issue #22518).

parent be7c414c
......@@ -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
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment