summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ev.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ev.c b/ev.c
index 38b3938..6ce1dbb 100644
--- a/ev.c
+++ b/ev.c
@@ -1059,7 +1059,7 @@ downheap (ANHE *heap, int N, int k)
{
int c = k << 1;
- if (c > N + HEAP0 - 1)
+ if (c >= N + HEAP0)
break;
c += c + 1 < N + HEAP0 && ANHE_at (heap [c]) > ANHE_at (heap [c + 1])