]> granicus.if.org Git - python/commitdiff
Replace usage of the deprecated Py_UNICODE_COPY() with Py_MEMCPY() in resize_copy()
authorVictor Stinner <victor.stinner@gmail.com>
Tue, 23 Oct 2012 00:54:47 +0000 (02:54 +0200)
committerVictor Stinner <victor.stinner@gmail.com>
Tue, 23 Oct 2012 00:54:47 +0000 (02:54 +0200)
Objects/unicodeobject.c

index a7efb01a0421224db8ac54b5a1b1c32ab72389ad..0a3712e2f30ebd15e73e173d0d8f91c558b3487e 100644 (file)
@@ -812,8 +812,8 @@ resize_copy(PyObject *unicode, Py_ssize_t length)
             return NULL;
         copy_length = _PyUnicode_WSTR_LENGTH(unicode);
         copy_length = Py_MIN(copy_length, length);
-        Py_UNICODE_COPY(_PyUnicode_WSTR(w), _PyUnicode_WSTR(unicode),
-                        copy_length);
+        Py_MEMCPY(_PyUnicode_WSTR(w), _PyUnicode_WSTR(unicode),
+                  copy_length * sizeof(wchar_t));
         return w;
     }
 }