diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-07-13 19:17:51 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-07-13 19:17:51 +0100 |
commit | 39276ce5d4284765d4372f92b5f0337751dba52e (patch) | |
tree | 6f8bc0d28e5303482348fbb6284c3ec1b028632f /src/lua | |
parent | 67ccec834e9be395a187da73e5db19df7321031e (diff) | |
download | rspamd-39276ce5d4284765d4372f92b5f0337751dba52e.tar.gz rspamd-39276ce5d4284765d4372f92b5f0337751dba52e.zip |
[Minor] Fix types when iterating hash
Diffstat (limited to 'src/lua')
-rw-r--r-- | src/lua/lua_mimepart.c | 12 |
1 files 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); } } |