]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Fix] Use 0 instead of LUA_OK for lua_pcall result comparison 5774/head
authorPetr Vaněk <arkamar@atlas.cz>
Tue, 2 Dec 2025 21:06:16 +0000 (22:06 +0100)
committerPetr Vaněk <arkamar@atlas.cz>
Tue, 2 Dec 2025 21:09:12 +0000 (22:09 +0100)
Lua 5.1 does not define LUA_OK, so the result of lua_pcall is compared
to 0 instead, which is consistent with the rest of the codebase.

Link: https://bugs.gentoo.org/967009
src/rspamadm/confighelp.c

index 04c8845a162400aad3214ebe25abfedc82ee8603..68617f86d2c4dde3ab75342489aee6b31fd8d6bb 100644 (file)
@@ -207,7 +207,7 @@ rspamadm_confighelp_load_plugins_doc(struct rspamd_config *cfg)
        lua_getglobal(L, "require");
        lua_pushstring(L, "rspamadm.confighelp_plugins");
 
-       if (lua_pcall(L, 1, 1, 0) != LUA_OK) {
+       if (lua_pcall(L, 1, 1, 0) != 0) {
                rspamd_fprintf(stderr, "cannot load confighelp_plugins module: %s\n",
                                           lua_tostring(L, -1));
                lua_pop(L, 1);
@@ -221,7 +221,7 @@ rspamadm_confighelp_load_plugins_doc(struct rspamd_config *cfg)
                return NULL;
        }
 
-       if (lua_pcall(L, 0, 1, 0) != LUA_OK) {
+       if (lua_pcall(L, 0, 1, 0) != 0) {
                rspamd_fprintf(stderr, "cannot execute confighelp_plugins function: %s\n",
                                           lua_tostring(L, -1));
                lua_pop(L, 1);