diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2005-01-11 12:29:08 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2005-01-11 12:29:08 +0000 |
commit | ab1ca331f49536505d59d1a6347feca2cbfbd2eb (patch) | |
tree | e59dc27f6c7115b8c09f58c50573a4540fa71608 /src/tar.c | |
parent | bb5e5067204929c47d177f30afcd440928af88d7 (diff) | |
download | cpio-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.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -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; |