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.
This commit is contained in:
Thomas Wouters 2006-02-16 19:34:37 +00:00
parent 13870b18f2
commit de01774dae

View file

@ -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)) {