[Python-checkins] cpython: Fix 'c' format of PyUnicode_Format()

victor.stinner python-checkins at python.org
Thu Sep 29 00:42:23 CEST 2011


http://hg.python.org/cpython/rev/876a36feb508
changeset: 72509:876a36feb508
user: Victor Stinner <victor.stinner at haypocalc.com>
date: Thu Sep 29 00:39:24 2011 +0200
summary:
 Fix 'c' format of PyUnicode_Format()
formatbuf is now an array of Py_UCS4, not of Py_UNICODE
files:
 Objects/unicodeobject.c | 2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -12254,7 +12254,7 @@
 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;
-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /