From 24a92ae013c8f82a5a64566a1128f3da140a0e08 Mon Sep 17 00:00:00 2001 From: Ed Schouten Date: Fri, 4 Nov 2011 19:56:34 +0000 Subject: [PATCH] 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(-) diff --git a/lib/libc/stdlib/realpath.c b/lib/libc/stdlib/realpath.c index 66bb8da9860..2c9562ea6e0 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);