From: Tomas Valla Date: Thu, 25 Oct 2012 13:47:30 +0000 (+0200) Subject: Mainloop: Fixed +1 error in heap usage. X-Git-Tag: v5.99~104 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=12b2eb1c3f53b2b73b2c916dd907c04834f70fde;p=libucw.git Mainloop: Fixed +1 error in heap usage. --- 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); }