summaryrefslogtreecommitdiffstats
path: root/src/lua/lua_regexp.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-08-15 16:20:41 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-08-15 16:20:59 +0100
commit938a0dba32a7f1632c3e14b92d986384aff19d7a (patch)
tree32e64f23e9bbed4c9123fb19972406ed6349d1d1 /src/lua/lua_regexp.c
parent46d32375ac0fe58156da513670ea7c9bccf0aed2 (diff)
downloadrspamd-938a0dba32a7f1632c3e14b92d986384aff19d7a.tar.gz
rspamd-938a0dba32a7f1632c3e14b92d986384aff19d7a.zip
[Minor] Better Lua 5.3 compatibility
Diffstat (limited to 'src/lua/lua_regexp.c')
-rw-r--r--src/lua/lua_regexp.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lua/lua_regexp.c b/src/lua/lua_regexp.c
index 896fb3d9b..e88dc1bcc 100644
--- a/src/lua/lua_regexp.c
+++ b/src/lua/lua_regexp.c
@@ -318,10 +318,10 @@ lua_regexp_set_max_hits (lua_State *L)
struct rspamd_lua_regexp *re = lua_check_regexp (L);
guint lim;
- lim = luaL_checknumber (L, 2);
+ lim = luaL_checkinteger (L, 2);
if (re && re->re && !IS_DESTROYED (re)) {
- lua_pushnumber (L, rspamd_regexp_set_maxhits (re->re, lim));
+ lua_pushinteger (L, rspamd_regexp_set_maxhits (re->re, lim));
}
else {
lua_pushnil (L);
@@ -342,10 +342,10 @@ lua_regexp_get_max_hits (lua_State *L)
struct rspamd_lua_regexp *re = lua_check_regexp (L);
if (re && re->re && !IS_DESTROYED (re)) {
- lua_pushnumber (L, rspamd_regexp_get_maxhits (re->re));
+ lua_pushinteger (L, rspamd_regexp_get_maxhits (re->re));
}
else {
- lua_pushnumber (L, 1);
+ lua_pushinteger (L, 1);
}
return 1;
@@ -580,7 +580,7 @@ lua_regexp_matchn (lua_State *L)
}
}
- lua_pushnumber (L, matches);
+ lua_pushinteger (L, matches);
return 1;
}