diff options
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) { |
