This patch removes all trailing LFs and Zeros from
log messages. Previously only the last LF was removed.
It's a regression from
e8ea0ae6f6 "BUG/MINOR: logs:
prevent double line returns in some events."
This should fix github issue #654
dataptr = message;
- /* historically some messages used to already contain the trailing LF */
- if (size && (dataptr[size-1] == '\n'))
+ /* historically some messages used to already contain the trailing LF
+ * or Zero. Let's remove all trailing LF or Zero
+ */
+ while (size && ((dataptr[size-1] == '\n' || (dataptr[size-1] == 0))))
size--;
if (logsrv->type == LOG_TARGET_FD) {