top: fix a segfault when -p switch specified invalid pid

In attempting to keep at least one task visible when
scrolling vertically, a negative task index would be
produced when pid monitoring was in effect and no
matching pid was found.

Since there were already other conditions where no
task might displayed, the faulty source line has been
removed.

Bug-Debian: http://bugs.debian.org/668335

Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
Jim Warner 2012-04-11 04:11:12 -05:00 committed by Craig Small
parent b079d130d7
commit cd253e0dc6

View File

@ -3774,7 +3774,6 @@ static int window_show (WIN_t *q, int wmax) {
} }
i = q->begtask; i = q->begtask;
if (i >= Frame_maxtask) i = q->begtask = Frame_maxtask - 1;
lwin = 1; // 1 for the column header lwin = 1; // 1 for the column header
wmax = winMIN(wmax, q->winlines + 1); // ditto for winlines, too wmax = winMIN(wmax, q->winlines + 1); // ditto for winlines, too