summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Wouters <thomas@python.org>2006-02-16 19:34:37 (GMT)
committerThomas Wouters <thomas@python.org>2006-02-16 19:34:37 (GMT)
commitde01774dae6771aa5abdaca2ef39e339ad223f8d (patch)
tree3b9002c2365923f168f0e83f7d6630eb2f8cf686
parent13870b18f2a843d568f82c89b72f33dc427b9b23 (diff)
downloadcpython-de01774dae6771aa5abdaca2ef39e339ad223f8d.zip
cpython-de01774dae6771aa5abdaca2ef39e339ad223f8d.tar.gz
cpython-de01774dae6771aa5abdaca2ef39e339ad223f8d.tar.bz2
Use correct PyArg_Parse format char for Py_ssize_t in unicode.center().
Fixes: >>> u"".center(10) Traceback (most recent call last): File "<stdin>", line 1, in <module> MemoryError on 64-bit systems.
-rw-r--r--Objects/unicodeobject.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index eaf9837..d353f1f 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -4853,7 +4853,7 @@ unicode_center(PyUnicodeObject *self, PyObject *args)
Py_ssize_t width;
Py_UNICODE fillchar = ' ';
- if (!PyArg_ParseTuple(args, "i|O&:center", &width, convert_uc, &fillchar))
+ if (!PyArg_ParseTuple(args, "n|O&:center", &width, convert_uc, &fillchar))
return NULL;
if (self->length >= width && PyUnicode_CheckExact(self)) {