]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix 'c' format of PyUnicode_Format()
authorVictor Stinner <victor.stinner@haypocalc.com>
Wed, 28 Sep 2011 22:39:24 +0000 (00:39 +0200)
committerVictor Stinner <victor.stinner@haypocalc.com>
Wed, 28 Sep 2011 22:39:24 +0000 (00:39 +0200)
formatbuf is now an array of Py_UCS4, not of Py_UNICODE

Objects/unicodeobject.c

index c6dcb58f600cfcc295c8677836b94303fd6ce079..bff74d9277023e774b379a2b619a779bc08846b0 100644 (file)
@@ -12254,7 +12254,7 @@ PyUnicode_Format(PyObject *format, PyObject *args)
             case 'c':
                 pbuf = formatbuf;
                 kind = PyUnicode_4BYTE_KIND;
-                len = formatchar(pbuf, sizeof(formatbuf)/sizeof(Py_UNICODE), v);
+                len = formatchar(pbuf, Py_ARRAY_LENGTH(formatbuf), v);
                 if (len < 0)
                     goto onError;
                 break;