about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/exit/atexit.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/exit/atexit.c b/src/exit/atexit.c
index 1b40cb9b..c31f3dc3 100644
--- a/src/exit/atexit.c
+++ b/src/exit/atexit.c
@@ -21,9 +21,8 @@ void __funcs_on_exit()
 	int i;
 	void (*func)(void *), *arg;
 	LOCK(lock);
-	for (; head; head=head->next) {
-		for (i=COUNT-1; i>=0 && !head->f[i]; i--);
-		if (i<0) continue;
+	for (; head; head=head->next) for (i=COUNT-1; i>=0; i--) {
+		if (!head->f[i]) continue;
 		func = head->f[i];
 		arg = head->a[i];
 		head->f[i] = 0;