diff options
Diffstat (limited to 'usr.bin/mail/list.c')
-rw-r--r-- | usr.bin/mail/list.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/usr.bin/mail/list.c b/usr.bin/mail/list.c index ddae30f7b84..c4a2813e4a1 100644 --- a/usr.bin/mail/list.c +++ b/usr.bin/mail/list.c @@ -1,4 +1,4 @@ -/* $OpenBSD: list.c,v 1.3 1997/01/17 07:12:49 millert Exp $ */ +/* $OpenBSD: list.c,v 1.4 1997/05/30 08:51:42 deraadt Exp $ */ /* $NetBSD: list.c,v 1.4 1996/06/08 19:48:30 christos Exp $ */ /* @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)list.c 8.2 (Berkeley) 4/19/94"; #else -static char rcsid[] = "$OpenBSD: list.c,v 1.3 1997/01/17 07:12:49 millert Exp $"; +static char rcsid[] = "$OpenBSD: list.c,v 1.4 1997/05/30 08:51:42 deraadt Exp $"; #endif #endif /* not lint */ @@ -685,7 +685,7 @@ matchsender(str, mesg) * previous search string. */ -char lastscan[128]; +char lastscan[STRINGLEN]; int matchsubj(str, mesg) char *str; @@ -697,8 +697,11 @@ matchsubj(str, mesg) str++; if (strlen(str) == 0) str = lastscan; - else - strcpy(lastscan, str); + else { + strncpy(lastscan, str, sizeof lastscan-1); + lastscan[sizeof lastscan-1] = '\0'; + } + mp = &message[mesg-1]; /* |