From 639dc397d7c1bbebd5cac6d94e7230443e8607ea Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Thu, 13 Jul 2017 19:17:51 +0100 Subject: [PATCH] [Minor] Fix types when iterating hash --- src/lua/lua_mimepart.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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); } } -- 2.39.5