summaryrefslogtreecommitdiff
path: root/usr.bin/tail
diff options
context:
space:
mode:
authorDaniel Hartmeier <dhartmei@cvs.openbsd.org>2003-04-08 00:04:07 +0000
committerDaniel Hartmeier <dhartmei@cvs.openbsd.org>2003-04-08 00:04:07 +0000
commit463a2397a9004430a9d21d80b123421c04695591 (patch)
treed957940fafe3905b35e3dc7ef18ecdef1502b9ba /usr.bin/tail
parent22ba33bff8af03cb49614bdda1af9db3f171921f (diff)
strlcpy conversion, increase buffer size by one char. ok millert@
Diffstat (limited to 'usr.bin/tail')
-rw-r--r--usr.bin/tail/tail.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/tail/tail.c b/usr.bin/tail/tail.c
index c483e823a29..6f8c7806ec4 100644
--- a/usr.bin/tail/tail.c
+++ b/usr.bin/tail/tail.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tail.c,v 1.8 2002/02/16 21:27:54 millert Exp $ */
+/* $OpenBSD: tail.c,v 1.9 2003/04/08 00:04:06 dhartmei Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -46,7 +46,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)tail.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: tail.c,v 1.8 2002/02/16 21:27:54 millert Exp $";
+static char rcsid[] = "$OpenBSD: tail.c,v 1.9 2003/04/08 00:04:06 dhartmei Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -244,7 +244,7 @@ obsolete(argv)
/* Malloc space for dash, new option and argument. */
len = strlen(*argv);
- if ((start = p = malloc(len + 3)) == NULL)
+ if ((start = p = malloc(len + 4)) == NULL)
err(1, NULL);
*p++ = '-';
@@ -278,7 +278,7 @@ obsolete(argv)
errx(1, "illegal option -- %s", *argv);
}
*p++ = *argv[0];
- (void)strcpy(p, ap);
+ (void)strlcpy(p, ap, start + len + 4 - p);
*argv = start;
continue;