Replace PyUnicode_AsUTF8AndSize() with PyUnicode_AsUTF8() to remove
the explicit check for embedded null characters.
} else {
/* "s" or "z" */
const char **p = va_arg(*p_va, const char **);
- Py_ssize_t len;
sarg = NULL;
if (c == 'z' && arg == Py_None)
*p = NULL;
else if (PyUnicode_Check(arg)) {
- sarg = PyUnicode_AsUTF8AndSize(arg, &len);
- if (sarg == NULL)
+ sarg = PyUnicode_AsUTF8(arg);
+ if (sarg == NULL) {
return converterr(CONV_UNICODE,
arg, msgbuf, bufsize);
- if (strlen(sarg) != (size_t)len) {
- PyErr_SetString(PyExc_ValueError, "embedded null character");
- RETURN_ERR_OCCURRED;
}
*p = sarg;
}