From 840ed7767c6fda33fab5f305645af6714d429409 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Tue, 22 Nov 2011 17:35:01 +0100 Subject: [PATCH] Fix compiler warning in message.c --- bacula/src/lib/message.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/bacula/src/lib/message.c b/bacula/src/lib/message.c index 5af7851074..f6712bca7a 100644 --- a/bacula/src/lib/message.c +++ b/bacula/src/lib/message.c @@ -666,7 +666,7 @@ static bool open_dest_file(JCR *jcr, DEST *d, const char *mode) } /* Split the output for syslog (it converts \n to ' ' and is - * limited to 1024c + * limited to 1024 characters per syslog message */ static void send_to_syslog(int mode, const char *msg) { @@ -675,9 +675,8 @@ static void send_to_syslog(int mode, const char *msg) const char *p2; const char *p = msg; - while (*p && ((p2 = strchr(p, '\n')) != NULL)) - { - len = MIN(sizeof(buf) - 1, p2 - p + 1); /* Add 1 to keep \n */ + while (*p && ((p2 = strchr(p, '\n')) != NULL)) { + len = MIN((int)sizeof(buf) - 1, p2 - p + 1); /* Add 1 to keep \n */ strncpy(buf, p, len); buf[len] = 0; syslog(mode, "%s", buf); -- 2.39.5