summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2011-11-04 19:56:34 +0000
committered <ed@FreeBSD.org>2011-11-04 19:56:34 +0000
commit71aa39a47b82d48a9255b29a05fc250c40f4ed51 (patch)
tree8351dfcbb2fa086e71768323e90a7b87942e03fa /lib
parent9528202f6c840dc5c1b99002e397f210185aca5d (diff)
downloadFreeBSD-src-71aa39a47b82d48a9255b29a05fc250c40f4ed51.zip
FreeBSD-src-71aa39a47b82d48a9255b29a05fc250c40f4ed51.tar.gz
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.
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/stdlib/realpath.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libc/stdlib/realpath.c b/lib/libc/stdlib/realpath.c
index 66bb8da..2c9562e 100644
--- a/lib/libc/stdlib/realpath.c
+++ b/lib/libc/stdlib/realpath.c
@@ -212,7 +212,8 @@ realpath(const char * __restrict path, char * __restrict resolved)
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);
OpenPOWER on IntegriCloud