Date: Sun, 1 Jan 2012 18:17:37 +0000 (UTC) From: Dimitry Andric <dim@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r229180 - stable/9/lib/libc/stdlib Message-ID: <201201011817.q01IHbs5024263@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: dim Date: Sun Jan 1 18:17:37 2012 New Revision: 229180 URL: http://svn.freebsd.org/changeset/base/229180 Log: MFC r227090: 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: stable/9/lib/libc/stdlib/realpath.c Directory Properties: stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/stdlib/realpath.c ============================================================================== --- stable/9/lib/libc/stdlib/realpath.c Sun Jan 1 17:47:52 2012 (r229179) +++ stable/9/lib/libc/stdlib/realpath.c Sun Jan 1 18:17:37 2012 (r229180) @@ -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?201201011817.q01IHbs5024263>