]> mj.ucw.cz Git - libucw.git/commitdiff
Mainloop: Fixed +1 error in heap usage.
authorTomas Valla <tom@ucw.cz>
Thu, 25 Oct 2012 13:47:30 +0000 (15:47 +0200)
committerTomas Valla <tom@ucw.cz>
Thu, 25 Oct 2012 13:47:30 +0000 (15:47 +0200)
ucw/mainloop.c

index 1fee8b011644b639778c6467604a650aa557e4a5..e2b968268596df84bfaf1572a544e6d9acf14593 100644 (file)
@@ -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);
        }