aboutsummaryrefslogtreecommitdiffstats
path: root/lib/libc/stdlib/realpath.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/stdlib/realpath.c')
-rw-r--r--lib/libc/stdlib/realpath.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/libc/stdlib/realpath.c b/lib/libc/stdlib/realpath.c
index b5177e9c221c..a01a5a8116db 100644
--- a/lib/libc/stdlib/realpath.c
+++ b/lib/libc/stdlib/realpath.c
@@ -36,6 +36,8 @@
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)realpath.c 8.1 (Berkeley) 2/16/94";
+static char rcsid[] =
+"$FreeBSD$";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
@@ -136,7 +138,8 @@ loop:
rootd = 0;
if (*wbuf) {
- if (strlen(resolved) + strlen(wbuf) + rootd + 1 > MAXPATHLEN) {
+ if (strlen(resolved) + strlen(wbuf) + (1-rootd) + 1 >
+ MAXPATHLEN) {
errno = ENAMETOOLONG;
goto err1;
}