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