Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 4 Nov 2011 19:56:34 +0000 (UTC)
From:      Ed Schouten <ed@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r227090 - head/lib/libc/stdlib
Message-ID:  <201111041956.pA4JuYB1032219@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ed
Date: Fri Nov  4 19:56:34 2011
New Revision: 227090
URL: http://svn.freebsd.org/changeset/base/227090

Log:
  Fix a warning emitted by Clang.
  
  The size passed to strlcat() must depend on the input length, not the
  output length. Because the input and output buffers are equal in size,
  the resulting binary does not change at all.

Modified:
  head/lib/libc/stdlib/realpath.c

Modified: head/lib/libc/stdlib/realpath.c
==============================================================================
--- head/lib/libc/stdlib/realpath.c	Fri Nov  4 19:12:07 2011	(r227089)
+++ head/lib/libc/stdlib/realpath.c	Fri Nov  4 19:56:34 2011	(r227090)
@@ -212,7 +212,8 @@ realpath(const char * __restrict path, c
 					symlink[slen] = '/';
 					symlink[slen + 1] = 0;
 				}
-				left_len = strlcat(symlink, left, sizeof(left));
+				left_len = strlcat(symlink, left,
+				    sizeof(symlink));
 				if (left_len >= sizeof(left)) {
 					if (m)
 						free(resolved);



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