Use strlcpy().

MFC after:	2 weeks
This commit is contained in:
delphij 2017-12-05 07:11:56 +00:00
parent 320c81ddec
commit 805a2c95ad

View File

@ -277,9 +277,9 @@ main(int argc, char *argv[])
if (asme) {
if (pwd->pw_shell != NULL && *pwd->pw_shell != '\0') {
/* must copy - pwd memory is recycled */
shell = strncpy(shellbuf, pwd->pw_shell,
strlcpy(shellbuf, pwd->pw_shell,
sizeof(shellbuf));
shellbuf[sizeof(shellbuf) - 1] = '\0';
shell = shellbuf;
}
else {
shell = _PATH_BSHELL;