svn commit: r206697 - head/sbin/hastd

Pawel Jakub Dawidek pjd at FreeBSD.org
Fri Apr 16 06:49:13 UTC 2010


Author: pjd
Date: Fri Apr 16 06:49:12 2010
New Revision: 206697
URL: http://svn.freebsd.org/changeset/base/206697

Log:
  Fix log size calculation which caused message truncation.
  
  Submitted by:	Mikolaj Golub <to.my.trociny at gmail.com>
  MFC after:	3 days

Modified:
  head/sbin/hastd/pjdlog.c

Modified: head/sbin/hastd/pjdlog.c
==============================================================================
--- head/sbin/hastd/pjdlog.c	Fri Apr 16 06:47:29 2010	(r206696)
+++ head/sbin/hastd/pjdlog.c	Fri Apr 16 06:49:12 2010	(r206697)
@@ -228,7 +228,7 @@ pjdlogv_common(int loglevel, int debugle
 
 		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));


More information about the svn-src-all mailing list