aboutsummaryrefslogtreecommitdiff
path: root/src/tar.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2005-01-11 12:29:08 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2005-01-11 12:29:08 +0000
commitab1ca331f49536505d59d1a6347feca2cbfbd2eb (patch)
treee59dc27f6c7115b8c09f58c50573a4540fa71608 /src/tar.c
parentbb5e5067204929c47d177f30afcd440928af88d7 (diff)
downloadcpio-ab1ca331f49536505d59d1a6347feca2cbfbd2eb.tar.gz
cpio-ab1ca331f49536505d59d1a6347feca2cbfbd2eb.tar.bz2
Use memset instead of bzero, memmove
(or memcpy, if appropriate), instead of bcopy, and strchr/strrchr instead of index/rindex.
Diffstat (limited to 'src/tar.c')
-rw-r--r--src/tar.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/tar.c b/src/tar.c
index 939d83a..5723258 100644
--- a/src/tar.c
+++ b/src/tar.c
@@ -142,7 +142,7 @@ write_out_tar_header (struct new_cpio_header *file_hdr, int out_des)
union tar_record tar_rec;
struct tar_header *tar_hdr = (struct tar_header *) &tar_rec;
- bzero ((char *) &tar_rec, TARRECORDSIZE);
+ memset (&tar_rec, 0, sizeof tar_rec);
/* process_copy_out must ensure that file_hdr->c_name is short enough,
or we will lose here. */
@@ -307,8 +307,7 @@ read_in_tar_header (struct new_cpio_header *file_hdr, int in_des)
error (0, 0, _("invalid header: checksum error"));
warned = true;
}
- bcopy (((char *) &tar_rec) + 1, (char *) &tar_rec,
- TARRECORDSIZE - 1);
+ memmove (&tar_rec, ((char *) &tar_rec) + 1, TARRECORDSIZE - 1);
tape_buffered_read (((char *) &tar_rec) + (TARRECORDSIZE - 1), in_des, 1);
++bytes_skipped;
continue;

Return to:

Send suggestions and report system problems to the System administrator.