commit 534c9ac: [Minor] Fix some meaningful compile warnings

Vsevolod Stakhov vsevolod at highsecure.ru
Fri Feb 8 14:35:09 UTC 2019


Author: Vsevolod Stakhov
Date: 2019-02-08 14:32:12 +0000
URL: https://github.com/rspamd/rspamd/commit/534c9aca14adf9819c2260132490331464d742a9 (HEAD -> master)

[Minor] Fix some meaningful compile warnings

---
 src/libutil/str_util.c  | 3 ++-
 src/lua/lua_cryptobox.c | 2 +-
 src/lua/lua_util.c      | 4 ++--
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/libutil/str_util.c b/src/libutil/str_util.c
index 25c88acee..06d7a6cc7 100644
--- a/src/libutil/str_util.c
+++ b/src/libutil/str_util.c
@@ -2754,8 +2754,9 @@ rspamd_str_make_utf_valid (const gchar *src, gsize slen, gsize *dstlen)
 	GString *dst;
 	const gchar *last;
 	gchar *dchar;
-	gsize i, valid, prev;
+	gsize valid, prev;
 	UChar32 uc;
+	gint32 i;
 
 	if (src == NULL) {
 		return NULL;
diff --git a/src/lua/lua_cryptobox.c b/src/lua/lua_cryptobox.c
index 70f29fa91..2a5d9e7ee 100644
--- a/src/lua/lua_cryptobox.c
+++ b/src/lua/lua_cryptobox.c
@@ -1875,7 +1875,7 @@ lua_cryptobox_encrypt_cookie (lua_State *L)
 		}
 
 		if (cookie_len > sizeof (padded_cookie) - 1) {
-			return luaL_error (L, "cookie is too long %d", (gint)padded_cookie);
+			return luaL_error (L, "cookie is too long %d", (gint)cookie_len);
 		}
 
 		/* Fill nonce */
diff --git a/src/lua/lua_util.c b/src/lua/lua_util.c
index 93051c0f1..d78e230e7 100644
--- a/src/lua/lua_util.c
+++ b/src/lua/lua_util.c
@@ -758,7 +758,7 @@ lua_util_config_from_ucl (lua_State *L)
 			int_options = parse_config_options(str_options);
 		}
 		else {
-			msg_err_config ("config_from_ucl: second parameter is expected to be string");
+			msg_err ("config_from_ucl: second parameter is expected to be string");
 			ucl_object_unref (obj);
 			lua_pushnil (L);
 		}
@@ -773,7 +773,7 @@ lua_util_config_from_ucl (lua_State *L)
 		top = rspamd_rcl_config_init (cfg, NULL);
 
 		if (!rspamd_rcl_parse (top, cfg, cfg, cfg->cfg_pool, cfg->rcl_obj, &err)) {
-			msg_err_config ("rcl parse error: %s", err->message);
+			msg_err ("rcl parse error: %s", err->message);
 			ucl_object_unref (obj);
 			lua_pushnil (L);
 		}


More information about the Commits mailing list