From: Tim Kientzle Date: Sat, 26 Jun 2010 06:17:32 +0000 (-0400) Subject: Use intmax_t for %jd printf arguments. X-Git-Tag: v3.0.0a~935 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=288425caacac14936649277cfee9c8fcf669c722;p=thirdparty%2Flibarchive.git Use intmax_t for %jd printf arguments. We should probably be using archive_string_sprintf here instead of printf to avoid the portability problem (not all platforms have intmax_t, not all have %jd). SVN-Revision: 2502 --- diff --git a/libarchive/archive_read_support_format_iso9660.c b/libarchive/archive_read_support_format_iso9660.c index 00944aede..96e0dd5d8 100644 --- a/libarchive/archive_read_support_format_iso9660.c +++ b/libarchive/archive_read_support_format_iso9660.c @@ -915,8 +915,8 @@ read_children(struct archive_read *a, struct file_info *parent) archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Ignoring out-of-order directory (%s) %jd > %jd", parent->name.s, - iso9660->current_position, - parent->offset); + (intmax_t)iso9660->current_position, + (intmax_t)parent->offset); return (ARCHIVE_WARN); } if (parent->offset + parent->size > iso9660->volume_size) { @@ -1280,7 +1280,8 @@ archive_read_format_iso9660_read_header(struct archive_read *a, "Ignoring out-of-order file @%jx (%s) %jd < %jd", (intmax_t)file->number, iso9660->pathname.s, - file->offset, iso9660->current_position); + (intmax_t)file->offset, + (intmax_t)iso9660->current_position); iso9660->entry_bytes_remaining = 0; iso9660->entry_sparse_offset = 0; return (ARCHIVE_WARN); @@ -1604,8 +1605,8 @@ archive_read_format_iso9660_read_data(struct archive_read *a, archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Ignoring out-of-order file (%s) %jd < %jd", iso9660->pathname.s, - iso9660->entry_content->offset, - iso9660->current_position); + (intmax_t)iso9660->entry_content->offset, + (intmax_t)iso9660->current_position); *buff = NULL; *size = 0; *offset = iso9660->entry_sparse_offset; diff --git a/libarchive/archive_write_set_format_iso9660.c b/libarchive/archive_write_set_format_iso9660.c index 669dc96a8..9776f1d40 100644 --- a/libarchive/archive_write_set_format_iso9660.c +++ b/libarchive/archive_write_set_format_iso9660.c @@ -3452,7 +3452,7 @@ wb_consume(struct archive_write *a, size_t size) archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Internal Program error: iso9660:wb_consume()" " size=%jd, wbuff_remaining=%jd", - (int64_t)size, (int64_t)iso9660->wbuff_remaining); + (intmax_t)size, (intmax_t)iso9660->wbuff_remaining); return (ARCHIVE_FATAL); } iso9660->wbuff_remaining -= size; @@ -6974,7 +6974,7 @@ setup_boot_information(struct archive_write *a) size = archive_entry_size(np->file->entry) - 64; if (size <= 0) { archive_set_error(&a->archive, errno, - "Boot file(%jd) is too small", size + 64); + "Boot file(%jd) is too small", (intmax_t)size + 64); return (ARCHIVE_FATAL); } sum = 0; diff --git a/libarchive/archive_write_set_format_pax.c b/libarchive/archive_write_set_format_pax.c index 3992d92f5..026fcadbb 100644 --- a/libarchive/archive_write_set_format_pax.c +++ b/libarchive/archive_write_set_format_pax.c @@ -908,7 +908,9 @@ archive_write_pax_header(struct archive_write *a, while (archive_entry_sparse_next(entry_main, &soffset, &slength) == ARCHIVE_OK) { archive_string_sprintf(&(pax->sparse_map), - "%jd\n%jd\n", soffset, slength); + "%jd\n%jd\n", + (intmax_t)soffset, + (intmax_t)slength); sparse_total += slength; if (sparse_list_add(pax, soffset, slength) != ARCHIVE_OK) {