From cae605b71c9a0e34f7a4251082832c47e2c50cdc Mon Sep 17 00:00:00 2001 From: ache Date: Tue, 3 Apr 2018 02:54:06 +0200 Subject: Fix bug end of list not cleaned --- wind.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'wind.c') diff --git a/wind.c b/wind.c index b2581c3..427a0ae 100644 --- a/wind.c +++ b/wind.c @@ -98,6 +98,7 @@ void printmenu(menuC* menu) { int w = menu->w; itemC* it = menu->list; int s = menu->nbElem; + int i = 0; if( menu->hl < (menu->firstElem) ) { menu->firstElem-=menu->h/2; @@ -116,7 +117,7 @@ void printmenu(menuC* menu) { } - for(int i = menu->firstElem ; i < (h+menu->firstElem) && i < s ; i++) { + for(i = menu->firstElem ; i < (h+menu->firstElem) && i < s ; i++) { int color = 0, attr = A_NORMAL; if( it[i].opt == 1 ) color = COLOR_BLUE+1; @@ -132,6 +133,10 @@ void printmenu(menuC* menu) { mvprintc(x,y++,it[i].cstr, w); attrset(0 | A_NORMAL); } + for( ; i < h+menu->firstElem ; i++) { + move(y++,x); + printw("%*s", w, " "); + } } void printStatus(void) { mvprintc(COLS-5,LINES-3," ",4); -- cgit v1.2.3