Use strlcpy().
MFC after: 2 weeks
This commit is contained in:
parent
320c81ddec
commit
805a2c95ad
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user