From: kay.sievers@vrfy.org Date: Fri, 19 Nov 2004 02:41:38 +0000 (+0100) Subject: [PATCH] let klibc add the trailing newline to syslog conditionally X-Git-Tag: 046~5 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=90e84c81486d757f1eec263565e605c1df500e7c;p=elogind.git [PATCH] let klibc add the trailing newline to syslog conditionally We get an empty line after every debug print from libsysfs, so don't add a second if we already have one. --- diff --git a/klibc/klibc/syslog.c b/klibc/klibc/syslog.c index 592992ba6..e9d84d9dd 100644 --- a/klibc/klibc/syslog.c +++ b/klibc/klibc/syslog.c @@ -60,7 +60,8 @@ void vsyslog(int prio, const char *format, va_list ap) len += vsnprintf(buf+len, BUFLEN-len, format, ap); if ( len > BUFLEN-1 ) len = BUFLEN-1; - buf[len++] = '\n'; + if (buf[len-1] != '\n') + buf[len++] = '\n'; fd = __syslog_fd; if ( fd == -1 )