From 21d13b43c2b916ff97b218966d91210825b77064 Mon Sep 17 00:00:00 2001 From: Luka Vretenar Date: Mon, 31 Aug 2026 11:36:34 +0200 Subject: [PATCH] Fix lua call wrapper pushing error handler after arguments Signed-off-by: Luka Vretenar --- lib/lua/lua_config.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/lua/lua_config.c b/lib/lua/lua_config.c index c4f54cdc..666bbe83 100644 --- a/lib/lua/lua_config.c +++ b/lib/lua/lua_config.c @@ -272,14 +272,13 @@ int lua_docall(lua_State *L, int narg, int nres) { int status; - int base = 0; - - base = lua_gettop(L); + int base = 1; lua_pushcfunction(L, msghandler); lua_insert(L, base); status = _k(L, lua_pcallk(L, narg, nres, base, 0, _k), 0); + lua_remove(L, base); /* remove message handler */ return status; }