The following diff should produce an identical binary, but the code
makes more sense. Found with clang.
Index: realpath.c
===================================================================
RCS file: /cvs/src/lib/libc/stdlib/realpath.c,v
retrieving revision 1.14
diff -u -p -r1.14 realpath.c
--- realpath.c 24 Jul 2011 21:03:00 -0000 1.14
+++ realpath.c 13 Sep 2012 12:29:31 -0000
@@ -187,7 +187,7 @@ realpath(const char *path, char *resolve
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)) {
errno = ENAMETOOLONG;
goto err;
--
Michal Mazurek