diff options
author | kris <kris@FreeBSD.org> | 2001-05-08 06:19:06 +0000 |
---|---|---|
committer | kris <kris@FreeBSD.org> | 2001-05-08 06:19:06 +0000 |
commit | 6f2ea93cf4d39dc17b5fff4bc84a55d6562c8cd4 (patch) | |
tree | 63ec355a438835dcc12c39eb54e9e286c4f71426 /bin/pax/tables.c | |
parent | 7ecc59e45de1a67ed22b32856a18f28bb30d36e6 (diff) | |
download | FreeBSD-src-6f2ea93cf4d39dc17b5fff4bc84a55d6562c8cd4.zip FreeBSD-src-6f2ea93cf4d39dc17b5fff4bc84a55d6562c8cd4.tar.gz |
Sync up with OpenBSD. Too many changes to note, but the major features
are:
* Implement cpio compatibility mode when pax is invoked as cpio
* Extend tar compatibility mode to cover many of the GNU tar single-letter
options (bzip2 mode, aka -y/-j is not present in OpenBSD). When
invoked as tar, pax is now full-featured enough for use by the ports
collection to extract distfiles and create packages.
* Many bug fixes to the operation of pax and the tar compatibility modes
* Code fixes for things like correct string buffer termination.
I tried to preserve existing FreeBSD fixes to this utility; please let me
know if I have inadvertently spammed something.
Diffstat (limited to 'bin/pax/tables.c')
-rw-r--r-- | bin/pax/tables.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/bin/pax/tables.c b/bin/pax/tables.c index 1a5b3fa..113b65a 100644 --- a/bin/pax/tables.c +++ b/bin/pax/tables.c @@ -180,8 +180,8 @@ chk_lnk(arcn) * other links. */ arcn->ln_nlen = l_strncpy(arcn->ln_name, pt->name, - PAXPATHLEN+1); - arcn->ln_name[PAXPATHLEN] = '\0'; + sizeof(arcn->ln_name) - 1); + arcn->ln_name[arcn->ln_nlen] = '\0'; if (arcn->type == PAX_REG) arcn->type = PAX_HRG; else @@ -624,12 +624,13 @@ add_name(oname, onamelen, nname) #ifdef __STDC__ void -sub_name(register char *oname, int *onamelen) +sub_name(register char *oname, int *onamelen, size_t onamesize) #else void -sub_name(oname, onamelen) +sub_name(oname, onamelen, onamesize) register char *oname; int *onamelen; + size_t onamesize; #endif { register NAMT *pt; @@ -653,8 +654,8 @@ sub_name(oname, onamelen) * found it, replace it with the new name * and return (we know that oname has enough space) */ - *onamelen = l_strncpy(oname, pt->nname, PAXPATHLEN+1); - oname[PAXPATHLEN] = '\0'; + *onamelen = l_strncpy(oname, pt->nname, onamesize - 1); + oname[*onamelen] = '\0'; return; } pt = pt->fow; |