summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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