Use strlcpy instead of strncpy.

Submitted by:	imp
Reviewed by:	silence on -audit
This commit is contained in:
Johan Karlsson 2003-02-22 18:08:34 +00:00
parent 90623e1a9e
commit 484251e7c4
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=111261

View File

@ -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) {