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:
Benjamin Peterson 2017-03-07 22:24:44 -08:00 committed by GitHub
parent 02371e0ed1
commit ad4a0cc519
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}