diff options
author | lum <lum@cvs.openbsd.org> | 2012-04-15 19:52:17 +0000 |
---|---|---|
committer | lum <lum@cvs.openbsd.org> | 2012-04-15 19:52:17 +0000 |
commit | 501b28ed2f79755579f808a6519e551963a649dd (patch) | |
tree | 7a9505f8739ff53b60ffda94e4b2535bcbd74d70 | |
parent | c4a658ec68a53e15c93a0ae02d9d5805c90cffbb (diff) |
Move the check for a <0 number of process display_lines to a better place.
This makes:
This terminal can only display -N processes.
a thing of the past.
-rw-r--r-- | usr.bin/top/display.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/top/display.c b/usr.bin/top/display.c index 30b358dd659..a45611d0e56 100644 --- a/usr.bin/top/display.c +++ b/usr.bin/top/display.c @@ -1,4 +1,4 @@ -/* $OpenBSD: display.c,v 1.41 2011/12/16 14:50:24 jsing Exp $ */ +/* $OpenBSD: display.c,v 1.42 2012/04/15 19:52:16 lum Exp $ */ /* * Top users/processes display for Unix @@ -147,6 +147,9 @@ display_resize(void) if (display_width >= MAX_COLS) display_width = MAX_COLS - 1; + if (display_lines < 0) + display_lines = 0; + /* return number of lines available */ /* for dumb terminals, pretend like we can show any amount */ return (smart_terminal ? display_lines : Largest); @@ -197,9 +200,6 @@ display_init(struct statics * statics) } } - if (display_lines < 0) - display_lines = 0; - /* return number of lines available */ return (display_lines); } |