aboutsummaryrefslogtreecommitdiffstats
path: root/util-src/signal.c
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2017-11-30 19:35:35 +0100
committerKim Alvefur <zash@zash.se>2017-11-30 19:35:35 +0100
commit5b30abd00062c7634d80596b196176b9b6e7e1c7 (patch)
tree36b588a27e32a0806f9371de10d0328144f84715 /util-src/signal.c
parentbb6a7489435bc23f4cdfdb921619089cfb1d4473 (diff)
downloadprosody-5b30abd00062c7634d80596b196176b9b6e7e1c7.tar.gz
prosody-5b30abd00062c7634d80596b196176b9b6e7e1c7.zip
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
Diffstat (limited to 'util-src/signal.c')
-rw-r--r--util-src/signal.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/util-src/signal.c b/util-src/signal.c
index b94beffa..9e6f6f63 100644
--- a/util-src/signal.c
+++ b/util-src/signal.c
@@ -172,7 +172,7 @@ static void sighook(lua_State *L, lua_Debug *ar) {
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 @@ static void handle(int sig) {
}
if(nsig < MAX_PENDING_SIGNALS) {
- signals[++nsig] = sig;
+ signals[nsig++] = sig;
}
}