summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorjohan <johan@FreeBSD.org>2003-02-22 18:08:34 +0000
committerjohan <johan@FreeBSD.org>2003-02-22 18:08:34 +0000
commit7030319e02dca27e580c2d54af0f2a7ff9cd16e4 (patch)
tree83e7789e161a996b9c2617a23a828a94a2a45100 /lib
parent23839916879abcc70dd879d7f17ed679c1c96d31 (diff)
downloadFreeBSD-src-7030319e02dca27e580c2d54af0f2a7ff9cd16e4.zip
FreeBSD-src-7030319e02dca27e580c2d54af0f2a7ff9cd16e4.tar.gz
Use strlcpy instead of strncpy.
Submitted by: imp Reviewed by: silence on -audit
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/stdlib/realpath.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/libc/stdlib/realpath.c b/lib/libc/stdlib/realpath.c
index 8429986..eff5d23 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) {
OpenPOWER on IntegriCloud