Diff

util-src/signal.c @ 8420:fb27aff6d491

util.signal: Fix loop (fixes #1047) A pre-commit version probably started with i = nsig and counted down, then an incomplete change to counting up was done
author Kim Alvefur <zash@zash.se>
date Thu, 30 Nov 2017 19:35:35 +0100
parent 8414:7ea3311ca632
child 9150:c1d5f52274cf
line wrap: on
line diff
--- a/util-src/signal.c	Thu Nov 30 18:47:06 2017 +0000
+++ b/util-src/signal.c	Thu Nov 30 19:35:35 2017 +0100
@@ -172,7 +172,7 @@
 	lua_pushstring(L, LUA_SIGNAL);
 	lua_gettable(L, LUA_REGISTRYINDEX);
 
-	for(int i = 1; i <= nsig; i--) {
+	for(int i = 0; i < nsig; i++) {
 		lua_pushnumber(L, signals[i]);
 		lua_gettable(L, -2);
 		lua_call(L, 0, 0);
@@ -196,7 +196,7 @@
 	}
 
 	if(nsig < MAX_PENDING_SIGNALS) {
-		signals[++nsig] = sig;
+		signals[nsig++] = sig;
 	}
 }