*offset = (off_t)offset64;
return (r);
}
-#endif
-#if ARCHIVE_VERSION_NUMBER < 3000000
+
static int
archive_read_data_block64(struct archive *_a,
const void **buff, size_t *size, int64_t *offset)
return (a->format->read_data)(a, buff, size, offset);
}
-#endif
static int
close_filters(struct archive_read *a)
#include "archive_read_private.h"
struct ar {
- off_t entry_bytes_remaining;
- off_t entry_offset;
- off_t entry_padding;
+ int64_t entry_bytes_remaining;
+ int64_t entry_offset;
+ int64_t entry_padding;
char *strtab;
size_t strtab_size;
char read_global_header;
* overflowing a size_t and against the filename size
* being larger than the entire entry. */
if (number > (uint64_t)(bsd_name_length + 1)
- || (off_t)bsd_name_length > ar->entry_bytes_remaining) {
+ || (int64_t)bsd_name_length > ar->entry_bytes_remaining) {
archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
"Bad input file size");
return (ARCHIVE_FATAL);
static int
archive_read_format_ar_skip(struct archive_read *a)
{
- off_t bytes_skipped;
+ int64_t bytes_skipped;
struct ar* ar;
ar = (struct ar *)(a->format->data);
struct archive_string line;
size_t buffsize;
char *buff;
- off_t offset;
+ int64_t offset;
int fd;
int filetype;
int archive_format;
struct archive_entry_linkresolver *resolver;
- off_t cur_size, cur_offset;
+ int64_t cur_size, cur_offset;
};
static int cleanup(struct archive_read *);
*buff = mtree->buff;
*offset = mtree->offset;
- if ((off_t)mtree->buffsize > mtree->cur_size - mtree->offset)
+ if ((int64_t)mtree->buffsize > mtree->cur_size - mtree->offset)
bytes_to_read = mtree->cur_size - mtree->offset;
else
bytes_to_read = mtree->buffsize;
*/
struct sparse_block {
struct sparse_block *next;
- off_t offset;
- off_t remaining;
+ int64_t offset;
+ int64_t remaining;
};
struct tar {
static int archive_block_is_null(const unsigned char *p);
static char *base64_decode(const char *, size_t, size_t *);
static void gnu_add_sparse_entry(struct tar *,
- off_t offset, off_t remaining);
+ int64_t offset, int64_t remaining);
static void gnu_clear_sparse_list(struct tar *);
static int gnu_sparse_old_read(struct archive_read *, struct tar *,
const struct archive_entry_header_gnutar *header);
read_body_to_string(struct archive_read *a, struct tar *tar,
struct archive_string *as, const void *h)
{
- off_t size, padded_size;
+ int64_t size, padded_size;
const struct archive_entry_header_ustar *header;
const void *src;
}
static void
-gnu_add_sparse_entry(struct tar *tar, off_t offset, off_t remaining)
+gnu_add_sparse_entry(struct tar *tar, int64_t offset, int64_t remaining)
{
struct sparse_block *p;
gnu_sparse_01_parse(struct tar *tar, const char *p)
{
const char *e;
- off_t offset = -1, size = -1;
+ int64_t offset = -1, size = -1;
for (;;) {
e = p;
{
ssize_t remaining, bytes_read;
int entries;
- off_t offset, size, to_skip;
+ int64_t offset, size, to_skip;
/* Clear out the existing sparse list. */
gnu_clear_sparse_list(tar);