From b9dcffb51e0075f70434febb6ea557cc4d22f5fd Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Thu, 29 Sep 2011 00:39:24 +0200 Subject: [PATCH] Fix 'c' format of PyUnicode_Format() formatbuf is now an array of Py_UCS4, not of Py_UNICODE --- Objects/unicodeobject.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index c6dcb58f600..bff74d92770 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;