From: Vsevolod Stakhov Date: Thu, 13 Jul 2017 18:17:51 +0000 (+0100) Subject: [Minor] Fix types when iterating hash X-Git-Tag: 1.7.0~855 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=39276ce5d4284765d4372f92b5f0337751dba52e;p=rspamd.git [Minor] Fix types when iterating hash --- diff --git a/src/lua/lua_mimepart.c b/src/lua/lua_mimepart.c index 8223b9fc5..012520553 100644 --- a/src/lua/lua_mimepart.c +++ b/src/lua/lua_mimepart.c @@ -828,7 +828,7 @@ lua_mimepart_get_type_common (lua_State * L, gboolean full) struct rspamd_mime_part *part = lua_check_mimepart (L); GHashTableIter it; gpointer k, v; - rspamd_ftok_t *akey, *avalue; + struct rspamd_content_type_param *param; if (part == NULL) { lua_pushnil (L); @@ -862,12 +862,12 @@ lua_mimepart_get_type_common (lua_State * L, gboolean full) g_hash_table_iter_init (&it, part->ct->attrs); while (g_hash_table_iter_next (&it, &k, &v)) { - akey = k; - avalue = v; + param = v; - if (akey->len > 0 && avalue->len > 0) { - lua_pushlstring (L, akey->begin, akey->len); - lua_pushlstring (L, avalue->begin, avalue->len); + if (param->name.len > 0 && param->name.len > 0) { + /* TODO: think about multiple values here */ + lua_pushlstring (L, param->name.begin, param->name.len); + lua_pushlstring (L, param->value.begin, param->value.len); lua_settable (L, -3); } }