From 10baacbeee3ecd13d3b9db3027259cb22083884c Mon Sep 17 00:00:00 2001 From: ckolivas Date: Thu, 19 Jun 2014 10:48:59 +1000 Subject: [PATCH] Use only one fprintf in console logging to minimise risk of overlap --- src/ckpool.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ckpool.c b/src/ckpool.c index c617f83c..336fd882 100644 --- a/src/ckpool.c +++ b/src/ckpool.c @@ -64,10 +64,10 @@ void logmsg(int loglevel, const char *fmt, ...) { flock(logfd, LOCK_UN); } if (loglevel <= LOG_WARNING) {\ - fprintf(stderr, "%s", buf); if (loglevel <= LOG_ERR && errno != 0) - fprintf(stderr, " with errno %d: %s", errno, strerror(errno)); - fprintf(stderr, "\n"); + fprintf(stderr, "%s with errno %d: %s\n", buf, errno, strerror(errno)); + else + fprintf(stderr, "%s\n", buf); fflush(stderr); } free(buf);