From: Miroslav Lichvar Date: Thu, 10 Jul 2008 12:45:04 +0000 (+0200) Subject: fix valgrind error in checkboxtree X-Git-Tag: r0-52-10~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=95f84a4eee124cbfa617a2f7f1286025fbe05fa3;p=thirdparty%2Fnewt.git fix valgrind error in checkboxtree --- diff --git a/checkboxtree.c b/checkboxtree.c index 7bd9de3..0d74ba7 100644 --- a/checkboxtree.c +++ b/checkboxtree.c @@ -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) {