diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-07-27 15:04:00 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-07-27 15:04:00 +0100 |
commit | db7c404ef5730e610c93fa810580892b41ddcdaa (patch) | |
tree | 02f4a53cbcbbde19739182c9f3820ba483472d55 | |
parent | d04d853075c827d504bfcb56846fbdc3563b9f65 (diff) | |
download | rspamd-db7c404ef5730e610c93fa810580892b41ddcdaa.tar.gz rspamd-db7c404ef5730e610c93fa810580892b41ddcdaa.zip |
[Minor] Ensure that log line is separated by space
-rw-r--r-- | src/libserver/logger/logger_console.c | 5 | ||||
-rw-r--r-- | src/libserver/logger/logger_file.c | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/libserver/logger/logger_console.c b/src/libserver/logger/logger_console.c index 3e142fe27..2c1c535d5 100644 --- a/src/libserver/logger/logger_console.c +++ b/src/libserver/logger/logger_console.c @@ -279,6 +279,11 @@ rspamd_log_console_log (const gchar *module, const gchar *id, mremain -= mr; } + /* Ensure that we have a space at the end */ + if (m > modulebuf && *(m - 1) != ' ') { + *(m - 1) = ' '; + } + iov[niov].iov_base = tmpbuf; iov[niov++].iov_len = r; iov[niov].iov_base = modulebuf; diff --git a/src/libserver/logger/logger_file.c b/src/libserver/logger/logger_file.c index 81c44f8e7..6531f9916 100644 --- a/src/libserver/logger/logger_file.c +++ b/src/libserver/logger/logger_file.c @@ -561,6 +561,11 @@ rspamd_log_file_log (const gchar *module, const gchar *id, mremain -= mr; } + /* Ensure that we have a space at the end */ + if (m > modulebuf && *(m - 1) != ' ') { + *(m - 1) = ' '; + } + /* Construct IOV for log line */ iov[0].iov_base = tmpbuf; iov[0].iov_len = r; |