summaryrefslogtreecommitdiff
path: root/src/atimer.c
diff options
context:
space:
mode:
authorGerd Moellmann <gerd@gnu.org>2000-03-12 17:01:02 +0000
committerGerd Moellmann <gerd@gnu.org>2000-03-12 17:01:02 +0000
commit4ab1d4be61e081dab81b3c235bb9ddfd43be5d2b (patch)
treeb6a4afa33b7d45132d41d82c82b150f1aa3b088f /src/atimer.c
parent9172b88ddf0f6cf94bdf9df36c74235ce09754dc (diff)
downloademacs-4ab1d4be61e081dab81b3c235bb9ddfd43be5d2b.tar.gz
(cancel_atimer): Break out of the loop as soon as timer
has been found. Fix bug not computing timer's predecessor.
Diffstat (limited to 'src/atimer.c')
-rw-r--r--src/atimer.c3
1 files changed, 2 insertions, 1 deletions
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;
}
}