From: Victor Stinner Date: Wed, 28 Sep 2011 22:39:24 +0000 (+0200) Subject: Fix 'c' format of PyUnicode_Format() X-Git-Tag: v3.3.0a1~1455 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b9dcffb51e0075f70434febb6ea557cc4d22f5fd;p=thirdparty%2FPython%2Fcpython.git Fix 'c' format of PyUnicode_Format() formatbuf is now an array of Py_UCS4, not of Py_UNICODE --- diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index c6dcb58f600c..bff74d927702 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -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;