]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
Push base32 encoded fuzzy.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 20 Sep 2014 21:25:00 +0000 (22:25 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 20 Sep 2014 21:25:00 +0000 (22:25 +0100)
src/lua/lua_task.c

index 3d149567430a3af3095dbf1a9e4954506192a743..127e6af4a5046a4d7b1beafb595008a812ff755c 100644 (file)
@@ -1898,14 +1898,18 @@ static gint
 lua_textpart_get_fuzzy (lua_State * L)
 {
        struct mime_text_part *part = lua_check_textpart (L);
+       gchar *out;
 
        if (part == NULL || part->is_empty) {
                lua_pushnil (L);
                return 1;
        }
 
-       lua_pushlstring (L, part->fuzzy->hash_pipe,
-               sizeof (part->fuzzy->hash_pipe));
+       out = rspamd_encode_base32 (part->fuzzy->hash_pipe,
+                       strlen (part->fuzzy->hash_pipe));
+       lua_pushstring (L, out);
+       g_free (out);
+
        return 1;
 }