diff options
| author | Johan Karlsson <johan@FreeBSD.org> | 2003-02-22 18:08:34 +0000 | 
|---|---|---|
| committer | Johan Karlsson <johan@FreeBSD.org> | 2003-02-22 18:08:34 +0000 | 
| commit | 484251e7c41d6176c555589d72de776e30c78126 (patch) | |
| tree | 83e7789e161a996b9c2617a23a828a94a2a45100 /lib/libc/stdlib/realpath.c | |
| parent | 90623e1a9e168e2272ca319283274e832955789a (diff) | |
Notes
Diffstat (limited to 'lib/libc/stdlib/realpath.c')
| -rw-r--r-- | lib/libc/stdlib/realpath.c | 3 | 
1 files changed, 1 insertions, 2 deletions
| diff --git a/lib/libc/stdlib/realpath.c b/lib/libc/stdlib/realpath.c index 8429986aed7b..eff5d234307a 100644 --- a/lib/libc/stdlib/realpath.c +++ b/lib/libc/stdlib/realpath.c @@ -82,8 +82,7 @@ realpath(path, resolved)  	 *     if it is a directory, then change to that directory.  	 * get the current directory name and append the basename.  	 */ -	(void)strncpy(resolved, path, PATH_MAX - 1); -	resolved[PATH_MAX - 1] = '\0'; +	(void)strlcpy(resolved, path, PATH_MAX);  loop:  	q = strrchr(resolved, '/');  	if (q != NULL) { | 
