summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--contrib/top/display.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/contrib/top/display.c b/contrib/top/display.c
index 22a940a..b1b6435 100644
--- a/contrib/top/display.c
+++ b/contrib/top/display.c
@@ -102,6 +102,8 @@ int display_resize()
/* if operating in "dumb" mode, we only need one line */
lines = smart_terminal ? screen_length - Header_lines : 1;
+ if (lines < 0)
+ lines = 0;
/* we don't want more than MAX_COLS columns, since the machine-dependent
modules make static allocations based on MAX_COLS and we don't want
to run off the end of their buffers */
OpenPOWER on IntegriCloud