diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 1997-07-30 07:19:32 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 1997-07-30 07:19:32 +0000 |
commit | 4c8a97d907a4ec836ce801ead5d8529e1699b553 (patch) | |
tree | b32005f8e56f3fd6c4c85600abe86627c2400953 /usr.bin/mail/lex.c | |
parent | 7ed1b7f7723a3536d9a9fdc71e9474fb5b2eb08f (diff) |
Make istrcpy() take a size (not length) field, now called istrncpy().
Change some strcpy() -> strncpy() out of paranoia.
Diffstat (limited to 'usr.bin/mail/lex.c')
-rw-r--r-- | usr.bin/mail/lex.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/usr.bin/mail/lex.c b/usr.bin/mail/lex.c index 1e59ce5e25b..2bd671ede6f 100644 --- a/usr.bin/mail/lex.c +++ b/usr.bin/mail/lex.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lex.c,v 1.13 1997/07/30 06:32:40 millert Exp $ */ +/* $OpenBSD: lex.c,v 1.14 1997/07/30 07:19:31 millert Exp $ */ /* $NetBSD: lex.c,v 1.10 1997/05/17 19:55:13 pk Exp $ */ /* @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)lex.c 8.2 (Berkeley) 4/20/95"; #else -static char rcsid[] = "$OpenBSD: lex.c,v 1.13 1997/07/30 06:32:40 millert Exp $"; +static char rcsid[] = "$OpenBSD: lex.c,v 1.14 1997/07/30 07:19:31 millert Exp $"; #endif #endif /* not lint */ @@ -134,8 +134,10 @@ setfile(name) shudclob = 1; edit = isedit; strcpy(prevfile, mailname); - if (name != mailname) - strcpy(mailname, name); + if (name != mailname) { + strncpy(mailname, name, sizeof(mailname) - 1); + mailname[sizeof(mailname) - 1] = '\0'; + } mailsize = fsize(ibuf); (void)snprintf(tempname, sizeof(tempname), "%s/mail.RxXXXXXXXXXX", tmpdir); |