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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user