]> git.ipfire.org Git - thirdparty/newt.git/commitdiff
fix valgrind error in checkboxtree
authorMiroslav Lichvar <mlichvar@redhat.com>
Thu, 10 Jul 2008 12:45:04 +0000 (14:45 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Thu, 10 Jul 2008 12:45:04 +0000 (14:45 +0200)
checkboxtree.c

index 7bd9de3628f4b90ce70b3ddffb604c5b6bed9c39..0d74ba75a1d8107e0d48e85e858d59d22f16734f 100644 (file)
@@ -501,8 +501,9 @@ static void ctDraw(newtComponent co) {
        list which is the last thing in the tree, and whose elements are
        displayed at the bottom of the screen */
     if (i < co->height) {
-       spaces = alloca(co->width);
+       spaces = alloca(co->width + 1);
        memset(spaces, ' ', co->width);
+       spaces[co->width] = '\0';
        SLsmg_set_color(NEWT_COLORSET_LISTBOX);
 
        while (i < co->height) {