]> granicus.if.org Git - python/commitdiff
Fixed compilation error introduced in 3f7519f633ed (issue #22518).
authorSerhiy Storchaka <storchaka@gmail.com>
Sat, 4 Oct 2014 11:51:44 +0000 (14:51 +0300)
committerSerhiy Storchaka <storchaka@gmail.com>
Sat, 4 Oct 2014 11:51:44 +0000 (14:51 +0300)
Python/codecs.c

index 8b8c037e93ca5220c5e7d376a277f8228575a038..a901d6de032f84eef7a026d26738365227255534 100644 (file)
@@ -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
         }