diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2005-10-28 13:03:49 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2005-10-28 13:03:49 +0000 |
commit | 3d63ed348fad6ab42daa0b89fcac113d4064ffaf (patch) | |
tree | 3483af42fab2bd185dce585ccd4b485aad59bca9 /src/copyout.c | |
parent | 95fe6143c15c32d5c17b385e6cb78f104163507d (diff) | |
download | cpio-3d63ed348fad6ab42daa0b89fcac113d4064ffaf.tar.gz cpio-3d63ed348fad6ab42daa0b89fcac113d4064ffaf.tar.bz2 |
(read_for_checksum,write_out_header): CRC is a 32-bit unsigned value. Patch proposed by Jim Castleberry and Peter Vrabec to fix Debian bug 335580
Diffstat (limited to 'src/copyout.c')
-rw-r--r-- | src/copyout.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/copyout.c b/src/copyout.c index 19b8d0a..77ac890 100644 --- a/src/copyout.c +++ b/src/copyout.c @@ -32,10 +32,10 @@ /* Read FILE_SIZE bytes of FILE_NAME from IN_FILE_DES and compute and return a checksum for them. */ -static unsigned long +static unsigned int read_for_checksum (int in_file_des, int file_size, char *file_name) { - unsigned long crc; + unsigned int crc; char buf[BUFSIZ]; int bytes_left; int bytes_read; @@ -292,9 +292,10 @@ write_out_header (struct new_cpio_header *file_hdr, int out_des) magic_string, file_hdr->c_ino, file_hdr->c_mode, file_hdr->c_uid, file_hdr->c_gid, file_hdr->c_nlink, file_hdr->c_mtime, - file_hdr->c_filesize, file_hdr->c_dev_maj, file_hdr->c_dev_min, - file_hdr->c_rdev_maj, file_hdr->c_rdev_min, file_hdr->c_namesize, - file_hdr->c_chksum); + file_hdr->c_filesize, file_hdr->c_dev_maj, file_hdr->c_dev_min, + file_hdr->c_rdev_maj, file_hdr->c_rdev_min, + file_hdr->c_namesize, + file_hdr->c_chksum & 0xffffffff); tape_buffered_write (ascii_header, out_des, 110L); /* Write file name to output. */ |