From 739973b510a045da415b248316f4d91b05115327 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Fri, 25 Nov 2016 18:15:07 +0000 Subject: [PATCH] [Minor] Fix log id --- src/libutil/logger.c | 4 +++- src/lua/lua_logger.c | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/libutil/logger.c b/src/libutil/logger.c index 604fe8348..082c12d14 100644 --- a/src/libutil/logger.c +++ b/src/libutil/logger.c @@ -993,7 +993,9 @@ file_log_function (const gchar *module, const gchar *id, m = modulebuf; if (id != NULL) { - mr = rspamd_snprintf (m, mremain, "<%*.s>; ", LOG_ID, + guint slen = strlen (id); + slen = MIN (LOG_ID, slen); + mr = rspamd_snprintf (m, mremain, "<%*.s>; ", slen, id); m += mr; mremain -= mr; diff --git a/src/lua/lua_logger.c b/src/lua/lua_logger.c index 4e10cc9c9..96ae39039 100644 --- a/src/lua/lua_logger.c +++ b/src/lua/lua_logger.c @@ -644,7 +644,7 @@ static gint lua_logger_logx (lua_State *L, GLogLevelFlags level, gboolean is_string) { gchar logbuf[RSPAMD_LOGBUF_SIZE - 128]; - const gchar *uid; + const gchar *uid = NULL; gint fmt_pos = 1; gboolean ret; -- 2.39.5