summaryrefslogtreecommitdiffstats
path: root/call
diff options
context:
space:
mode:
authorThomas Osterried <thomas@osterried.de>2009-04-29 10:19:24 +0000
committerThomas Osterried <thomas@osterried.de>2009-04-29 10:19:24 +0000
commite845be2860a351ccbbef43c4efafe48b259163d4 (patch)
treeafbf0a7e64f7d2fbd7f28b3a966a9e5bfd548295 /call
parent4c8bbc197653cd1ae37d1b9d80b62878979a2d33 (diff)
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.
Diffstat (limited to 'call')
-rw-r--r--call/menu.c5
1 files changed, 3 insertions, 2 deletions
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,