commit e39008c: [Minor] Try to fix types

Vsevolod Stakhov vsevolod at highsecure.ru
Mon Jun 17 15:56:04 UTC 2019


Author: Vsevolod Stakhov
Date: 2019-06-17 16:55:31 +0100
URL: https://github.com/rspamd/rspamd/commit/e39008c291e4b7bede0328df76fccd06b33c5703 (HEAD -> master)

[Minor] Try to fix types

---
 src/lua/lua_task.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/lua/lua_task.c b/src/lua/lua_task.c
index 8359ccd9c..d1abe6a2b 100644
--- a/src/lua/lua_task.c
+++ b/src/lua/lua_task.c
@@ -4883,7 +4883,7 @@ lua_task_get_settings_id (lua_State *L)
 	if (task != NULL) {
 
 		if (task->settings_elt) {
-			lua_pushnumber (L, task->settings_elt->id);
+			lua_pushinteger (L, task->settings_elt->id);
 		}
 		else {
 			lua_pushnil (L);
@@ -4901,7 +4901,7 @@ lua_task_set_settings_id (lua_State *L)
 {
 	LUA_TRACE_POINT;
 	struct rspamd_task *task = lua_check_task (L, 1);
-	guint32 id = luaL_checknumber (L, 2);
+	guint32 id = lua_tointeger (L, 2);
 
 	if (task != NULL && id != 0) {
 
@@ -4916,7 +4916,7 @@ lua_task_set_settings_id (lua_State *L)
 					id);
 
 			if (!task->settings_elt) {
-				return luaL_error (L, "settings id %d is unknown", id);
+				return luaL_error (L, "settings id %u is unknown", id);
 			}
 		}
 


More information about the Commits mailing list