From 12b2eb1c3f53b2b73b2c916dd907c04834f70fde Mon Sep 17 00:00:00 2001 From: Tomas Valla Date: Thu, 25 Oct 2012 15:47:30 +0200 Subject: [PATCH] Mainloop: Fixed +1 error in heap usage. --- ucw/mainloop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ucw/mainloop.c b/ucw/mainloop.c index 1fee8b01..e2b96826 100644 --- a/ucw/mainloop.c +++ b/ucw/mainloop.c @@ -259,7 +259,7 @@ timer_add(struct main_timer *tm, timestamp_t expires) if (!tm->expires) { tm->expires = expires; - tm->index = num_timers + 1; + tm->index = num_timers; GARY_RESIZE(m->timer_table, num_timers + 2); HEAP_INSERT(struct main_timer *, m->timer_table, tm->index, MAIN_TIMER_LESS, MAIN_TIMER_SWAP, tm); } -- 2.39.2