Issue #8651: Fix "z#" format of PyArg_Parse*() function: the size was not

written if PY_SSIZE_T_CLEAN is defined.
This commit is contained in:
Victor Stinner 2011-05-03 15:06:11 +02:00
parent 112d48ac17
commit 645b9f67ae
2 changed files with 8 additions and 4 deletions

View file

@ -984,10 +984,11 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags,
if (*format == '#') {
FETCH_SIZE;
assert(0); /* XXX redundant with if-case */
if (arg == Py_None)
*q = 0;
else
*q = PyString_Size(arg);
if (arg == Py_None) {
STORE_SIZE(0);
} else {
STORE_SIZE(PyString_Size(arg));
}
format++;
}
else if (*p != NULL &&