aboutsummaryrefslogtreecommitdiffstats
path: root/libarchive/archive_read_support_format_cpio.c
diff options
context:
space:
mode:
authorMartin Matuska <mm@FreeBSD.org>2012-07-27 08:24:12 +0000
committerMartin Matuska <mm@FreeBSD.org>2012-07-27 08:24:12 +0000
commit81418b36c02b6434acd4b8ae4cfb8c80a3742fd4 (patch)
tree4b551422581ae9a8093415e07c619e2a59ef6a7b /libarchive/archive_read_support_format_cpio.c
parent132160f77407d2174d2bec0a8ba9c6eefc4429d7 (diff)
downloadsrc-81418b36c02b6434acd4b8ae4cfb8c80a3742fd4.tar.gz
src-81418b36c02b6434acd4b8ae4cfb8c80a3742fd4.zip
Update libarchive's vendor dist to version 3.0.4 from release branch.vendor/libarchive/3.0.4
Git branch: release Git commit: 8076b31490c90aaf0edccecf760004c30bd95edc Obtained from: https://github.com/libarchive/libarchive.git
Notes
Notes: svn path=/vendor/libarchive/dist/; revision=238825 svn path=/vendor/libarchive/3.0.4/; revision=238833; tag=vendor/libarchive/3.0.4
Diffstat (limited to 'libarchive/archive_read_support_format_cpio.c')
-rw-r--r--libarchive/archive_read_support_format_cpio.c55
1 files changed, 35 insertions, 20 deletions
diff --git a/libarchive/archive_read_support_format_cpio.c b/libarchive/archive_read_support_format_cpio.c
index a1f842a30243..ff29e1ffd973 100644
--- a/libarchive/archive_read_support_format_cpio.c
+++ b/libarchive/archive_read_support_format_cpio.c
@@ -398,11 +398,12 @@ archive_read_format_cpio_read_header(struct archive_read *a,
/* If this is a symlink, read the link contents. */
if (archive_entry_filetype(entry) == AE_IFLNK) {
- h = __archive_read_ahead(a, cpio->entry_bytes_remaining, NULL);
+ h = __archive_read_ahead(a,
+ (size_t)cpio->entry_bytes_remaining, NULL);
if (h == NULL)
return (ARCHIVE_FATAL);
if (archive_entry_copy_symlink_l(entry, (const char *)h,
- cpio->entry_bytes_remaining, sconv) != 0) {
+ (size_t)cpio->entry_bytes_remaining, sconv) != 0) {
if (errno == ENOMEM) {
archive_set_error(&a->archive, ENOMEM,
"Can't allocate memory for Linkname");
@@ -458,7 +459,7 @@ archive_read_format_cpio_read_data(struct archive_read *a,
if (bytes_read <= 0)
return (ARCHIVE_FATAL);
if (bytes_read > cpio->entry_bytes_remaining)
- bytes_read = cpio->entry_bytes_remaining;
+ bytes_read = (ssize_t)cpio->entry_bytes_remaining;
*size = bytes_read;
cpio->entry_bytes_unconsumed = bytes_read;
*offset = cpio->entry_offset;
@@ -603,17 +604,23 @@ header_newc(struct archive_read *a, struct cpio *cpio,
/* TODO: Abort here? */
}
- archive_entry_set_devmajor(entry, atol16(header + newc_devmajor_offset, newc_devmajor_size));
- archive_entry_set_devminor(entry, atol16(header + newc_devminor_offset, newc_devminor_size));
+ archive_entry_set_devmajor(entry,
+ (dev_t)atol16(header + newc_devmajor_offset, newc_devmajor_size));
+ archive_entry_set_devminor(entry,
+ (dev_t)atol16(header + newc_devminor_offset, newc_devminor_size));
archive_entry_set_ino(entry, atol16(header + newc_ino_offset, newc_ino_size));
- archive_entry_set_mode(entry, atol16(header + newc_mode_offset, newc_mode_size));
+ archive_entry_set_mode(entry,
+ (mode_t)atol16(header + newc_mode_offset, newc_mode_size));
archive_entry_set_uid(entry, atol16(header + newc_uid_offset, newc_uid_size));
archive_entry_set_gid(entry, atol16(header + newc_gid_offset, newc_gid_size));
- archive_entry_set_nlink(entry, atol16(header + newc_nlink_offset, newc_nlink_size));
- archive_entry_set_rdevmajor(entry, atol16(header + newc_rdevmajor_offset, newc_rdevmajor_size));
- archive_entry_set_rdevminor(entry, atol16(header + newc_rdevminor_offset, newc_rdevminor_size));
+ archive_entry_set_nlink(entry,
+ (unsigned int)atol16(header + newc_nlink_offset, newc_nlink_size));
+ archive_entry_set_rdevmajor(entry,
+ (dev_t)atol16(header + newc_rdevmajor_offset, newc_rdevmajor_size));
+ archive_entry_set_rdevminor(entry,
+ (dev_t)atol16(header + newc_rdevminor_offset, newc_rdevminor_size));
archive_entry_set_mtime(entry, atol16(header + newc_mtime_offset, newc_mtime_size), 0);
- *namelength = atol16(header + newc_namesize_offset, newc_namesize_size);
+ *namelength = (size_t)atol16(header + newc_namesize_offset, newc_namesize_size);
/* Pad name to 2 more than a multiple of 4. */
*name_pad = (2 - *namelength) & 3;
@@ -767,15 +774,19 @@ header_odc(struct archive_read *a, struct cpio *cpio,
/* Parse out octal fields. */
header = (const char *)h;
- archive_entry_set_dev(entry, atol8(header + odc_dev_offset, odc_dev_size));
+ archive_entry_set_dev(entry,
+ (dev_t)atol8(header + odc_dev_offset, odc_dev_size));
archive_entry_set_ino(entry, atol8(header + odc_ino_offset, odc_ino_size));
- archive_entry_set_mode(entry, atol8(header + odc_mode_offset, odc_mode_size));
+ archive_entry_set_mode(entry,
+ (mode_t)atol8(header + odc_mode_offset, odc_mode_size));
archive_entry_set_uid(entry, atol8(header + odc_uid_offset, odc_uid_size));
archive_entry_set_gid(entry, atol8(header + odc_gid_offset, odc_gid_size));
- archive_entry_set_nlink(entry, atol8(header + odc_nlink_offset, odc_nlink_size));
- archive_entry_set_rdev(entry, atol8(header + odc_rdev_offset, odc_rdev_size));
+ archive_entry_set_nlink(entry,
+ (unsigned int)atol8(header + odc_nlink_offset, odc_nlink_size));
+ archive_entry_set_rdev(entry,
+ (dev_t)atol8(header + odc_rdev_offset, odc_rdev_size));
archive_entry_set_mtime(entry, atol8(header + odc_mtime_offset, odc_mtime_size), 0);
- *namelength = atol8(header + odc_namesize_offset, odc_namesize_size);
+ *namelength = (size_t)atol8(header + odc_namesize_offset, odc_namesize_size);
*name_pad = 0; /* No padding of filename. */
/*
@@ -816,15 +827,19 @@ header_afiol(struct archive_read *a, struct cpio *cpio,
/* Parse out octal fields. */
header = (const char *)h;
- archive_entry_set_dev(entry, atol16(header + afiol_dev_offset, afiol_dev_size));
+ archive_entry_set_dev(entry,
+ (dev_t)atol16(header + afiol_dev_offset, afiol_dev_size));
archive_entry_set_ino(entry, atol16(header + afiol_ino_offset, afiol_ino_size));
- archive_entry_set_mode(entry, atol8(header + afiol_mode_offset, afiol_mode_size));
+ archive_entry_set_mode(entry,
+ (mode_t)atol8(header + afiol_mode_offset, afiol_mode_size));
archive_entry_set_uid(entry, atol16(header + afiol_uid_offset, afiol_uid_size));
archive_entry_set_gid(entry, atol16(header + afiol_gid_offset, afiol_gid_size));
- archive_entry_set_nlink(entry, atol16(header + afiol_nlink_offset, afiol_nlink_size));
- archive_entry_set_rdev(entry, atol16(header + afiol_rdev_offset, afiol_rdev_size));
+ archive_entry_set_nlink(entry,
+ (unsigned int)atol16(header + afiol_nlink_offset, afiol_nlink_size));
+ archive_entry_set_rdev(entry,
+ (dev_t)atol16(header + afiol_rdev_offset, afiol_rdev_size));
archive_entry_set_mtime(entry, atol16(header + afiol_mtime_offset, afiol_mtime_size), 0);
- *namelength = atol16(header + afiol_namesize_offset, afiol_namesize_size);
+ *namelength = (size_t)atol16(header + afiol_namesize_offset, afiol_namesize_size);
*name_pad = 0; /* No padding of filename. */
cpio->entry_bytes_remaining =