Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Apr 2010 06:49:13 +0000 (UTC)
From:      Pawel Jakub Dawidek <pjd@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r206697 - head/sbin/hastd
Message-ID:  <201004160649.o3G6nDIk047109@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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@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));



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201004160649.o3G6nDIk047109>