summaryrefslogtreecommitdiff
path: root/bin/cp/cp.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2003-03-13 09:09:52 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2003-03-13 09:09:52 +0000
commitcd64a50f546ecbfd25035373ee745bd04e4e5905 (patch)
tree86a1452cec538b8f5259a45745e95cd1161d04e7 /bin/cp/cp.c
parent6153e3b8d9aedd43b1300c4d60217039c9485e02 (diff)
lots of sprintf -> snprintf and strcpy -> strlcpy; checked by tedu
Diffstat (limited to 'bin/cp/cp.c')
-rw-r--r--bin/cp/cp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/bin/cp/cp.c b/bin/cp/cp.c
index 80222030835..ee8e50b7cea 100644
--- a/bin/cp/cp.c
+++ b/bin/cp/cp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cp.c,v 1.21 2003/01/06 01:52:52 millert Exp $ */
+/* $OpenBSD: cp.c,v 1.22 2003/03/13 09:09:20 deraadt Exp $ */
/* $NetBSD: cp.c,v 1.14 1995/09/07 06:14:51 jtc Exp $ */
/*
@@ -47,7 +47,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)cp.c 8.5 (Berkeley) 4/29/95";
#else
-static char rcsid[] = "$OpenBSD: cp.c,v 1.21 2003/01/06 01:52:52 millert Exp $";
+static char rcsid[] = "$OpenBSD: cp.c,v 1.22 2003/03/13 09:09:20 deraadt Exp $";
#endif
#endif /* not lint */
@@ -188,7 +188,7 @@ main(int argc, char *argv[])
target = argv[--argc];
if (strlen(target) >= sizeof(to.p_path))
errx(1, "%s: name too long", target);
- (void)strcpy(to.p_path, target);
+ (void)strlcpy(to.p_path, target, sizeof to.p_path);
to.p_end = to.p_path + strlen(to.p_path);
if (to.p_path == to.p_end) {
*to.p_end++ = '.';