aboutsummaryrefslogtreecommitdiffstats
path: root/src/lua/lua_common.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-07-01 13:29:06 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-07-01 13:29:06 +0100
commita2a3df8b76cbe92bb56f82ae25362e4d0d440f19 (patch)
tree7df0e2b43f100c124f784b985c08f4ef9cc3d048 /src/lua/lua_common.c
parentdbe77ff6ecd18b43d520addbcc88217170c1d85b (diff)
downloadrspamd-a2a3df8b76cbe92bb56f82ae25362e4d0d440f19.tar.gz
rspamd-a2a3df8b76cbe92bb56f82ae25362e4d0d440f19.zip
[Minor] Fix parse_table_arguments
Diffstat (limited to 'src/lua/lua_common.c')
-rw-r--r--src/lua/lua_common.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/src/lua/lua_common.c b/src/lua/lua_common.c
index 354a932f9..cf909e021 100644
--- a/src/lua/lua_common.c
+++ b/src/lua/lua_common.c
@@ -1320,6 +1320,9 @@ rspamd_lua_parse_table_arguments (lua_State *L, gint pos,
if (how != RSPAMD_LUA_PARSE_ARGUMENTS_IGNORE_MISSING) {
*(va_arg (ap, const gchar **)) = NULL;
}
+ else {
+ (void)va_arg (ap, gchar **);
+ }
}
else {
g_set_error (err,
@@ -1342,13 +1345,16 @@ rspamd_lua_parse_table_arguments (lua_State *L, gint pos,
case 'I':
if (t == LUA_TNUMBER) {
- *(va_arg (ap, gint64 *)) = lua_tonumber (L, idx);
+ *(va_arg (ap, gint64 *)) = lua_tointeger (L, idx);
}
else if (t == LUA_TNIL || t == LUA_TNONE) {
failed = TRUE;
if (how != RSPAMD_LUA_PARSE_ARGUMENTS_IGNORE_MISSING) {
*(va_arg (ap, gint64 *)) = 0;
}
+ else {
+ (void)va_arg (ap, gint64 *);
+ }
}
else {
g_set_error (err,
@@ -1383,6 +1389,9 @@ rspamd_lua_parse_table_arguments (lua_State *L, gint pos,
if (how != RSPAMD_LUA_PARSE_ARGUMENTS_IGNORE_MISSING) {
*(va_arg (ap, gint *)) = -1;
}
+ else {
+ (void)va_arg (ap, gint *);
+ }
if (is_table) {
lua_pop (L, 1);
@@ -1450,6 +1459,9 @@ rspamd_lua_parse_table_arguments (lua_State *L, gint pos,
if (how != RSPAMD_LUA_PARSE_ARGUMENTS_IGNORE_MISSING) {
*(va_arg (ap, gdouble *)) = 0;
}
+ else {
+ (void)va_arg (ap, gdouble *);
+ }
}
else {
g_set_error (err,
@@ -1481,6 +1493,9 @@ rspamd_lua_parse_table_arguments (lua_State *L, gint pos,
if (how != RSPAMD_LUA_PARSE_ARGUMENTS_IGNORE_MISSING) {
*(va_arg (ap, gdouble *)) = NAN;
}
+ else {
+ (void)va_arg (ap, gdouble *);
+ }
}
else {
g_set_error (err,
@@ -1516,6 +1531,9 @@ rspamd_lua_parse_table_arguments (lua_State *L, gint pos,
*(va_arg (ap, const char **)) = NULL;
*valuelen = 0;
}
+ else {
+ (void)va_arg (ap, const char **);
+ }
}
else {
g_set_error (err,
@@ -1547,6 +1565,9 @@ rspamd_lua_parse_table_arguments (lua_State *L, gint pos,
if (how != RSPAMD_LUA_PARSE_ARGUMENTS_IGNORE_MISSING) {
*(va_arg (ap, ucl_object_t **)) = NULL;
}
+ else {
+ (void)va_arg (ap, ucl_object_t **);
+ }
}
if (is_table) {
@@ -1560,6 +1581,9 @@ rspamd_lua_parse_table_arguments (lua_State *L, gint pos,
if (how != RSPAMD_LUA_PARSE_ARGUMENTS_IGNORE_MISSING) {
*(va_arg (ap, void **)) = NULL;
}
+ else {
+ (void)va_arg (ap, void **);
+ }
}
else if (t != LUA_TUSERDATA) {
g_set_error (err,