Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 11 Dec 2010 08:07:21 +0000 (UTC)
From:      Kevin Lo <kevlo@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r216369 - head/lib/libipsec
Message-ID:  <201012110807.oBB87LHd099229@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kevlo
Date: Sat Dec 11 08:07:21 2010
New Revision: 216369
URL: http://svn.freebsd.org/changeset/base/216369

Log:
  The use of snprintf() to append to a buffer is not valid according to C99

Modified:
  head/lib/libipsec/ipsec_dump_policy.c

Modified: head/lib/libipsec/ipsec_dump_policy.c
==============================================================================
--- head/lib/libipsec/ipsec_dump_policy.c	Sat Dec 11 00:36:35 2010	(r216368)
+++ head/lib/libipsec/ipsec_dump_policy.c	Sat Dec 11 08:07:21 2010	(r216369)
@@ -162,7 +162,8 @@ ipsec_dump_policy(policy, delimiter)
 			return NULL;
 		}
 		buf = newbuf;
-		snprintf(buf, buflen, "%s%s%s", buf, delimiter, isrbuf);
+		snprintf(buf + strlen(buf), buflen - strlen(buf),
+		    "%s%s", delimiter, isrbuf);
 
 		off += xisr->sadb_x_ipsecrequest_len;
 	}



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