From 1181490d6c335d7f89bb15d882bc234f3ea443bd Mon Sep 17 00:00:00 2001 From: pjd Date: Fri, 16 Apr 2010 06:49:12 +0000 Subject: Fix log size calculation which caused message truncation. Submitted by: Mikolaj Golub MFC after: 3 days --- sbin/hastd/pjdlog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sbin/hastd') diff --git a/sbin/hastd/pjdlog.c b/sbin/hastd/pjdlog.c index 38c5539..9f8b3f4 100644 --- a/sbin/hastd/pjdlog.c +++ b/sbin/hastd/pjdlog.c @@ -228,7 +228,7 @@ pjdlogv_common(int loglevel, int debuglevel, int error, const char *fmt, len = snprintf(log, sizeof(log), "%s", pjdlog_prefix); if ((size_t)len < sizeof(log)) - len = vsnprintf(log + len, sizeof(log) - len, fmt, ap); + len += vsnprintf(log + len, sizeof(log) - len, fmt, ap); if (error != -1 && (size_t)len < sizeof(log)) { (void)snprintf(log + len, sizeof(log) - len, ": %s.", strerror(error)); -- cgit v1.1