]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
Slightly improve local functions output.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 6 Aug 2015 18:01:46 +0000 (19:01 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 6 Aug 2015 18:01:46 +0000 (19:01 +0100)
src/lua/lua_logger.c

index b84d1623fe28f1438b224ce6a53e88dc13248e8d..f5ddb2ca7c31f421ae5188a633885697291c0de1 100644 (file)
@@ -272,7 +272,7 @@ lua_logger_out_userdata (lua_State *L, gint pos, gchar *outbuf, gsize len)
 {
        gint r;
 
-       if (!lua_getmetatable (L, pos) || len == 0) {
+       if (!lua_getmetatable (L, pos)) {
                return 0;
        }
 
@@ -399,6 +399,9 @@ lua_logger_out_type (lua_State *L, gint pos, gchar *outbuf, gsize len)
        case LUA_TUSERDATA:
                r = lua_logger_out_userdata (L, pos, outbuf, len);
                break;
+       case LUA_TFUNCTION:
+               r = rspamd_snprintf (outbuf, len + 1, "function");
+               break;
        default:
                /* Try to push everything as string using tostring magic */
                r = lua_logger_out_str (L, pos, outbuf, len);