]> mj.ucw.cz Git - libucw.git/blobdiff - ucw/mainloop.c
UCW::CGI: Documented the changes
[libucw.git] / ucw / mainloop.c
index e2b968268596df84bfaf1572a544e6d9acf14593..b5e54965bb87de3e8fab2b3ba877b4c491553832 100644 (file)
@@ -259,9 +259,9 @@ timer_add(struct main_timer *tm, timestamp_t expires)
       if (!tm->expires)
        {
          tm->expires = expires;
       if (!tm->expires)
        {
          tm->expires = expires;
-         tm->index = num_timers;
+         tm->index = num_timers + 1;
          GARY_RESIZE(m->timer_table, num_timers + 2);
          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
        {
        }
       else
        {