summaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authordwmalone <dwmalone@FreeBSD.org>2002-08-11 18:37:25 +0000
committerdwmalone <dwmalone@FreeBSD.org>2002-08-11 18:37:25 +0000
commita74d1427785b126ce1dff1b514cc71763b2a1cb0 (patch)
tree12e190bed096f2e29d50ba691135e110947dc462 /contrib
parent7465309faa645f39be1f0ba0b1cfc7a3706e83c2 (diff)
downloadFreeBSD-src-a74d1427785b126ce1dff1b514cc71763b2a1cb0.zip
FreeBSD-src-a74d1427785b126ce1dff1b514cc71763b2a1cb0.tar.gz
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
Diffstat (limited to 'contrib')
-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