From 4ab1d4be61e081dab81b3c235bb9ddfd43be5d2b Mon Sep 17 00:00:00 2001 From: Gerd Moellmann Date: Sun, 12 Mar 2000 17:01:02 +0000 Subject: [PATCH] (cancel_atimer): Break out of the loop as soon as timer has been found. Fix bug not computing timer's predecessor. --- src/atimer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/atimer.c b/src/atimer.c index eafe0f5ebf6..a05498ba845 100644 --- a/src/atimer.c +++ b/src/atimer.c @@ -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; } }