Issue #6093: Fix off-by-one error in locale.strxfrm.

This commit is contained in:
Martin v. Löwis 2009-05-23 10:38:26 +00:00
parent eccb2ce3c0
commit db1c399fe0
2 changed files with 6 additions and 1 deletions

View File

@ -54,6 +54,11 @@ Library
now it does. This also means getfp method now returns the real fp.
Extension Modules
-----------------
- Issue #6093: Fix off-by-one error in locale.strxfrm.
Tests
-----

View File

@ -314,7 +314,7 @@ PyLocale_strxfrm(PyObject* self, PyObject* args)
PyErr_NoMemory();
goto exit;
}
n2 = wcsxfrm(buf, s, n2);
n2 = wcsxfrm(buf, s, n2+1);
}
result = PyUnicode_FromWideChar(buf, n2);
exit: