1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-11-15 09:44:04 +00:00

Fix an off-by-one in top.c (sf.net #3538234)

bug reported by arclance
This commit is contained in:
Pavel Labath 2012-06-26 23:22:59 +02:00
parent 623560267b
commit 8827d6158e

View File

@ -703,7 +703,7 @@ static int insert_sp_element(struct sorted_process *sp_cur,
sp_cur->greater = *p_sp_tail; sp_cur->greater = *p_sp_tail;
*p_sp_tail = sp_cur; *p_sp_tail = sp_cur;
did_insert = x; 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. /* We inserted an element and now the list is too big by one.
* Destroy the smallest element */ * Destroy the smallest element */
sp_destroy = *p_sp_tail; sp_destroy = *p_sp_tail;