BUG/MEDIUM: logs: fix trailing zeros on log message.

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

(cherry picked from commit fa9d780119adc687e58a8b09e55780a0173b4ab4)
Signed-off-by: Willy Tarreau <w@1wt.eu>
(cherry picked from commit f04244848065cced26b65034391e996420fb6d95)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
diff --git a/src/log.c b/src/log.c
index 1cd98a0..5c6c8e4 100644
--- a/src/log.c
+++ b/src/log.c
@@ -1505,8 +1505,10 @@
 
 	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->addr.ss_family == AF_UNSPEC) {