Commit 4ab1d4be authored by Gerd Moellmann's avatar Gerd Moellmann
Browse files

(cancel_atimer): Break out of the loop as soon as timer

has been found.  Fix bug not computing timer's predecessor.
parent 9172b88d
......@@ -176,7 +176,7 @@ cancel_atimer (timer)
struct atimer **list = i ? &stopped_atimers : &atimers;
/* See if TIMER is active or stopped. */
for (t = *list, prev = 0; t && t != timer; t = t->next)
for (t = *list, prev = NULL; t && t != timer; prev = t, t = t->next)
;
/* If it is, take it off the its list, and put in on the
......@@ -191,6 +191,7 @@ cancel_atimer (timer)
t->next = free_atimers;
free_atimers = t;
break;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment