last: fix smatch warning

login-utils/last.c +447 ttyconv(11) error: buffer overflow '(arg)' 3 <= 3

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
Sami Kerola 2011-09-10 16:49:58 +02:00
parent d6d11fa5c6
commit 889f1215f6
1 changed files with 1 additions and 1 deletions

View File

@ -448,7 +448,7 @@ ttyconv(char *arg) {
(void)strcpy(mval, "console");
else {
(void)strcpy(mval, "tty");
(void)strcpy(mval + 3, arg);
(void)strncpy(mval + 3, arg, 4);
}
return mval;
}