summaryrefslogtreecommitdiff
path: root/bin/pax
diff options
context:
space:
mode:
authorlebel <lebel@cvs.openbsd.org>2001-06-26 14:55:14 +0000
committerlebel <lebel@cvs.openbsd.org>2001-06-26 14:55:14 +0000
commit13d149b9e215af55777017e4cd44525d4fd81645 (patch)
treee1be16b268be01182c4f3612417e6864b5c4f84a /bin/pax
parent3c754c27c6a186e65d8a72d4f3e3eb97d3ccdf1f (diff)
really use strlcpy.
Diffstat (limited to 'bin/pax')
-rw-r--r--bin/pax/tar.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/bin/pax/tar.c b/bin/pax/tar.c
index e088dd36375..8d792570ac8 100644
--- a/bin/pax/tar.c
+++ b/bin/pax/tar.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tar.c,v 1.19 2001/06/26 14:19:33 lebel Exp $ */
+/* $OpenBSD: tar.c,v 1.20 2001/06/26 14:55:13 lebel Exp $ */
/* $NetBSD: tar.c,v 1.5 1995/03/21 09:07:49 cgd Exp $ */
/*-
@@ -42,7 +42,7 @@
#if 0
static char sccsid[] = "@(#)tar.c 8.2 (Berkeley) 4/18/94";
#else
-static char rcsid[] = "$OpenBSD: tar.c,v 1.19 2001/06/26 14:19:33 lebel Exp $";
+static char rcsid[] = "$OpenBSD: tar.c,v 1.20 2001/06/26 14:55:13 lebel Exp $";
#endif
#endif /* not lint */
@@ -1020,7 +1020,7 @@ ustar_wr(arcn)
* occur, we remove the / and copy the first part to the prefix
*/
*pt = '\0';
- strncpy(hd->prefix, arcn->name, sizeof(hd->prefix));
+ strlcpy(hd->prefix, arcn->name, sizeof(hd->prefix));
*pt++ = '/';
} else
memset(hd->prefix, 0, sizeof(hd->prefix));
@@ -1029,7 +1029,7 @@ ustar_wr(arcn)
* copy the name part. this may be the whole path or the part after
* the prefix
*/
- strncpy(hd->name, pt, sizeof(hd->name));
+ strlcpy(hd->name, pt, sizeof(hd->name));
/*
* set the fields in the header that are type dependent
@@ -1072,7 +1072,7 @@ ustar_wr(arcn)
hd->typeflag = SYMTYPE;
else
hd->typeflag = LNKTYPE;
- strncpy(hd->linkname,arcn->ln_name, sizeof(hd->linkname));
+ strlcpy(hd->linkname,arcn->ln_name, sizeof(hd->linkname));
memset(hd->devmajor, 0, sizeof(hd->devmajor));
memset(hd->devminor, 0, sizeof(hd->devminor));
if (ul_oct((u_long)0L, hd->size, sizeof(hd->size), 3))