]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Recorded merge of revisions 83444 via svnmerge from
authorGeorg Brandl <georg@python.org>
Sun, 1 Aug 2010 20:54:22 +0000 (20:54 +0000)
committerGeorg Brandl <georg@python.org>
Sun, 1 Aug 2010 20:54:22 +0000 (20:54 +0000)
svn+ssh://svn.python.org/python/branches/py3k

........
  r83444 | georg.brandl | 2010-08-01 22:51:02 +0200 (So, 01 Aug 2010) | 1 line

  Revert r83395, it introduces test failures and is not necessary anyway since we now have to nul-terminate the string anyway.
........

Objects/unicodeobject.c

index a18c571e83b91a90325cd3dcf078270eed685c8b..199f34ae562c1718dc8ba7bed2878368e10b267e 100644 (file)
@@ -3597,7 +3597,7 @@ PyObject *PyUnicode_EncodeUnicodeEscape(const Py_UNICODE *s,
 
             ch2 = *s++;
             size--;
-            if (ch2 >= 0xDC00 && ch2 <= 0xDFFF && size) {
+            if (ch2 >= 0xDC00 && ch2 <= 0xDFFF) {
                 ucs = (((ch & 0x03FF) << 10) | (ch2 & 0x03FF)) + 0x00010000;
                 *p++ = '\\';
                 *p++ = 'U';
@@ -3839,7 +3839,7 @@ PyObject *PyUnicode_EncodeRawUnicodeEscape(const Py_UNICODE *s,
 
                 ch2 = *s++;
                 size--;
-                if (ch2 >= 0xDC00 && ch2 <= 0xDFFF && size) {
+                if (ch2 >= 0xDC00 && ch2 <= 0xDFFF) {
                     ucs = (((ch & 0x03FF) << 10) | (ch2 & 0x03FF)) + 0x00010000;
                     *p++ = '\\';
                     *p++ = 'U';