summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>2005-09-15 17:25:52 +0000
committerache <ache@FreeBSD.org>2005-09-15 17:25:52 +0000
commit64235b259f7e66836a368e5da83478171cc651cc (patch)
treed9b243b1daa5c8a88f77f11226da37587cb86627 /lib
parent977932f9e5f9828562c169edd6bea59f44ff9308 (diff)
downloadFreeBSD-src-64235b259f7e66836a368e5da83478171cc651cc.zip
FreeBSD-src-64235b259f7e66836a368e5da83478171cc651cc.tar.gz
Cosmetic fixes to prev. commit.
Change first MAXPATHLEN to more standard PATH_MAX Change second MAXPATHLEN to 1024 (it is temp buffer not related) Change comment to reflect that. Suggested by: bde
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/gen/getcwd.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/libc/gen/getcwd.c b/lib/libc/gen/getcwd.c
index cb3e04c..6e0eda5 100644
--- a/lib/libc/gen/getcwd.c
+++ b/lib/libc/gen/getcwd.c
@@ -91,7 +91,7 @@ getcwd(pt, size)
}
ept = pt + size;
} else {
- if ((pt = malloc(ptsize = MAXPATHLEN)) == NULL)
+ if ((pt = malloc(ptsize = PATH_MAX)) == NULL)
return (NULL);
ept = pt + ptsize;
}
@@ -111,11 +111,11 @@ getcwd(pt, size)
*bpt = '\0';
/*
- * Allocate MAXPATHLEN bytes for the string of "../"'s.
- * Should always be enough (it's 340 levels). If it's not, allocate
+ * Allocate 1024 bytes for the string of "../"'s.
+ * Should always be enough. If it's not, allocate
* as necessary. Special case the first stat, it's ".", not "..".
*/
- if ((up = malloc(upsize = MAXPATHLEN)) == NULL)
+ if ((up = malloc(upsize = 1024)) == NULL)
goto err;
eup = up + upsize;
bup = up;
OpenPOWER on IntegriCloud