aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/stdlib
diff options
context:
space:
mode:
authorJacques Vidrine <nectar@FreeBSD.org>2003-08-03 23:47:39 +0000
committerJacques Vidrine <nectar@FreeBSD.org>2003-08-03 23:47:39 +0000
commit11b343033727270cb1d51f2f03857043cd0289d7 (patch)
treea5d88e71d256f630c181d59573ea9d400db2e0c1 /lib/libc/stdlib
parentbcf84153c8d063a1ba9646c8375e8fd083ad6a4b (diff)
Notes
Diffstat (limited to 'lib/libc/stdlib')
-rw-r--r--lib/libc/stdlib/realpath.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libc/stdlib/realpath.c b/lib/libc/stdlib/realpath.c
index 0217dde5f6a6..520624a9fef2 100644
--- a/lib/libc/stdlib/realpath.c
+++ b/lib/libc/stdlib/realpath.c
@@ -138,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;
}