summaryrefslogtreecommitdiff
path: root/usr.bin/banner
diff options
context:
space:
mode:
authorlebel <lebel@cvs.openbsd.org>2001-06-21 16:35:19 +0000
committerlebel <lebel@cvs.openbsd.org>2001-06-21 16:35:19 +0000
commit6517a1030c124b6705275cfe40c193b7169a7b10 (patch)
tree4acdde80e82d348bfc417f4b2e66dd63603b7119 /usr.bin/banner
parent9a9e6f5ad5e62fcbb206166d05df818fdc3df84c (diff)
use strlcpy vs strncpy+a[len-1]='\0'; Brian Poole <raj@cerias.purdue.edu>
Diffstat (limited to 'usr.bin/banner')
-rw-r--r--usr.bin/banner/banner.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/usr.bin/banner/banner.c b/usr.bin/banner/banner.c
index ee4d1eb90d4..114867c4e15 100644
--- a/usr.bin/banner/banner.c
+++ b/usr.bin/banner/banner.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: banner.c,v 1.3 1998/12/07 20:09:40 deraadt Exp $ */
+/* $OpenBSD: banner.c,v 1.4 2001/06/21 16:35:18 lebel Exp $ */
/* $NetBSD: banner.c,v 1.2 1995/04/09 06:00:15 cgd Exp $ */
/*
@@ -62,7 +62,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)printjob.c 8.2 (Berkeley) 4/16/94";
#else
-static char rcsid[] = "$OpenBSD: banner.c,v 1.3 1998/12/07 20:09:40 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: banner.c,v 1.4 2001/06/21 16:35:18 lebel Exp $";
#endif
#endif /* not lint */
@@ -173,8 +173,7 @@ main(argc, argv)
char word[10+1]; /* strings limited to 10 chars */
while (*++argv) {
- (void)strncpy(word, *argv, sizeof (word) - 1);
- word[sizeof (word) - 1] = '\0';
+ (void)strlcpy(word, *argv, sizeof (word));
scan_out(1, word, '\0');
}
exit(0);