1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-25 07:49:18 +00:00

Use strlcpy().

MFC after:	2 weeks
This commit is contained in:
Xin LI 2017-12-05 07:11:56 +00:00
parent 807e955710
commit aff7b6c709
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=326561

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;