diff options
author | johan <johan@FreeBSD.org> | 2003-02-22 18:08:34 +0000 |
---|---|---|
committer | johan <johan@FreeBSD.org> | 2003-02-22 18:08:34 +0000 |
commit | 7030319e02dca27e580c2d54af0f2a7ff9cd16e4 (patch) | |
tree | 83e7789e161a996b9c2617a23a828a94a2a45100 /lib/libc/stdlib | |
parent | 23839916879abcc70dd879d7f17ed679c1c96d31 (diff) | |
download | FreeBSD-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/libc/stdlib')
-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 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) { |