From 8827d6158e13e222a3e392f6c01a8c78088dfb7b Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Tue, 26 Jun 2012 23:22:59 +0200 Subject: [PATCH] Fix an off-by-one in top.c (sf.net #3538234) bug reported by arclance --- src/top.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/top.c b/src/top.c index dd395f39..a53970ed 100644 --- a/src/top.c +++ b/src/top.c @@ -703,7 +703,7 @@ static int insert_sp_element(struct sorted_process *sp_cur, sp_cur->greater = *p_sp_tail; *p_sp_tail = sp_cur; did_insert = x; - } else if (x >= max_elements) { + } else if (x > max_elements) { /* We inserted an element and now the list is too big by one. * Destroy the smallest element */ sp_destroy = *p_sp_tail;