Use strlcpy().
MFC after: 2 weeks
This commit is contained in:
parent
807e955710
commit
aff7b6c709
@ -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