From 71aa39a47b82d48a9255b29a05fc250c40f4ed51 Mon Sep 17 00:00:00 2001 From: ed Date: Fri, 4 Nov 2011 19:56:34 +0000 Subject: 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. --- lib/libc/stdlib/realpath.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/libc') 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); -- cgit v1.1