allow the first call to wcsxfrm to return ERANGE (#536)
If the output buffer provided to wcsxfrm is too small, errno is set to ERANGE. We should not error out in that case.
This commit is contained in:
parent
02371e0ed1
commit
ad4a0cc519
|
@ -262,7 +262,7 @@ PyLocale_strxfrm(PyObject* self, PyObject* args)
|
|||
}
|
||||
errno = 0;
|
||||
n2 = wcsxfrm(buf, s, n1);
|
||||
if (errno) {
|
||||
if (errno && errno != ERANGE) {
|
||||
PyErr_SetFromErrno(PyExc_OSError);
|
||||
goto exit;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue