From e845be2860a351ccbbef43c4efafe48b259163d4 Mon Sep 17 00:00:00 2001 From: Thomas Osterried Date: Wed, 29 Apr 2009 10:19:24 +0000 Subject: on modern systems, the ncurses gui crash in wtouchln() or wnoutrefresh() [ncurses functions], called from winclose() in menu.c. Debunging with gdb showed that wtab->fline was a large negative number. Now doing better checking that wtab->fline and wtab->lline is > 0. Seems that this fix is sufficient. If it will come out that it is not, we'll write a wtouchln() wrapper which checks if the arguments are positive and reasonable small. --- call/menu.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'call') diff --git a/call/menu.c b/call/menu.c index 9ad397c..6c0c2d7 100644 --- a/call/menu.c +++ b/call/menu.c @@ -62,8 +62,9 @@ void winclose(wint * wtab) awin_lines = awin->lline - awin->fline; while (wtab->next != NULL) { - if (awin->lline >= wtab->fline - && awin->fline <= wtab->lline) { + if (wtab->fline >= 0 && wtab->lline >= 0 && + awin->lline >= wtab->fline && + awin->fline <= wtab->lline) { if (wtab->fline <= awin->fline) { if (wtab->lline < awin->lline) { wtouchln(wtab->ptr, -- cgit v1.2.3