]> mj.ucw.cz Git - libucw.git/blobdiff - ucw/mainloop.c
Opt: docs fixes
[libucw.git] / ucw / mainloop.c
index 1fee8b011644b639778c6467604a650aa557e4a5..b5e54965bb87de3e8fab2b3ba877b4c491553832 100644 (file)
@@ -261,7 +261,7 @@ timer_add(struct main_timer *tm, timestamp_t expires)
          tm->expires = expires;
          tm->index = num_timers + 1;
          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);
+         HEAP_INSERT(struct main_timer *, m->timer_table, num_timers, MAIN_TIMER_LESS, MAIN_TIMER_SWAP, tm);
        }
       else
        {