From de01774dae6771aa5abdaca2ef39e339ad223f8d Mon Sep 17 00:00:00 2001 From: Thomas Wouters Date: Thu, 16 Feb 2006 19:34:37 +0000 Subject: Use correct PyArg_Parse format char for Py_ssize_t in unicode.center(). Fixes: >>> u"".center(10) Traceback (most recent call last): File "", line 1, in MemoryError on 64-bit systems. --- Objects/unicodeobject.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)) { -- cgit v0.12