Commits

Anonymous committed 890bb90

- Fix an off-by-one bug in locale.strxfrm().

Patch taken from http://bugs.debian.org/416934.

  • Participants
  • Parent commits 343eef3
  • Branches 2.5

Comments (0)

Files changed (2)

 - Bug #1633621: if curses.resizeterm() or curses.resize_term() is called,
   update _curses.LINES, _curses.COLS, curses.LINES and curses.COLS.
 
+- Fix an off-by-one bug in locale.strxfrm().
+
 Library
 -------
 

File Modules/_localemodule.c

     buf = PyMem_Malloc(n1);
     if (!buf)
         return PyErr_NoMemory();
-    n2 = strxfrm(buf, s, n1);
+    n2 = strxfrm(buf, s, n1) + 1;
     if (n2 > n1) {
         /* more space needed */
         buf = PyMem_Realloc(buf, n2);