- Fix an off-by-one bug in locale.strxfrm().
patch taken from http://bugs.debian.org/416934.
This commit is contained in:
parent
9e56d5beeb
commit
e19e0c21ae
|
@ -681,6 +681,9 @@ Extension Modules
|
||||||
- Bug #1633621: if curses.resizeterm() or curses.resize_term() is called,
|
- Bug #1633621: if curses.resizeterm() or curses.resize_term() is called,
|
||||||
update _curses.LINES, _curses.COLS, curses.LINES and curses.COLS.
|
update _curses.LINES, _curses.COLS, curses.LINES and curses.COLS.
|
||||||
|
|
||||||
|
- Fix an off-by-one bug in locale.strxfrm().
|
||||||
|
|
||||||
|
|
||||||
Tests
|
Tests
|
||||||
-----
|
-----
|
||||||
|
|
||||||
|
|
|
@ -360,7 +360,7 @@ PyLocale_strxfrm(PyObject* self, PyObject* args)
|
||||||
buf = PyMem_Malloc(n1);
|
buf = PyMem_Malloc(n1);
|
||||||
if (!buf)
|
if (!buf)
|
||||||
return PyErr_NoMemory();
|
return PyErr_NoMemory();
|
||||||
n2 = strxfrm(buf, s, n1);
|
n2 = strxfrm(buf, s, n1) + 1;
|
||||||
if (n2 > n1) {
|
if (n2 > n1) {
|
||||||
/* more space needed */
|
/* more space needed */
|
||||||
buf = PyMem_Realloc(buf, n2);
|
buf = PyMem_Realloc(buf, n2);
|
||||||
|
|
Loading…
Reference in New Issue