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.
This commit is contained in:
Ed Schouten 2011-11-04 19:56:34 +00:00
parent 5ddfea8c43
commit 24a92ae013

View file

@ -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);