From a74d1427785b126ce1dff1b514cc71763b2a1cb0 Mon Sep 17 00:00:00 2001 From: dwmalone Date: Sun, 11 Aug 2002 18:37:25 +0000 Subject: Fix a bug where you couldn't start top in a very small window. Now you can start it in a small window, but it doesn't always display anything sensible. Resizing the window does work though. The patch is a slightly simpler one than Sheldon's in the PR. PR: 21075 --- contrib/top/display.c | 2 ++ 1 file changed, 2 insertions(+) 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 */ -- cgit v1.1