From 5cd1e030b1b5fe9889aba8d39d260c4435c05309 Mon Sep 17 00:00:00 2001 From: Joerg Sonnenberger Date: Thu, 25 Feb 2010 11:16:36 -0500 Subject: [PATCH] Sort out the remaining format string vs argument types mismatches. SVN-Revision: 1988 --- libarchive/archive_write_set_format_ar.c | 4 ++-- libarchive/archive_write_set_format_iso9660.c | 2 +- libarchive/archive_write_set_format_mtree.c | 12 ++++++------ libarchive/archive_write_set_format_shar.c | 15 +++++++-------- libarchive/archive_write_set_format_ustar.c | 2 +- 5 files changed, 17 insertions(+), 18 deletions(-) diff --git a/libarchive/archive_write_set_format_ar.c b/libarchive/archive_write_set_format_ar.c index 00c9c7b87..3e70f363f 100644 --- a/libarchive/archive_write_set_format_ar.c +++ b/libarchive/archive_write_set_format_ar.c @@ -445,8 +445,8 @@ archive_write_ar_finish_entry(struct archive_write *a) if (ar->entry_padding != 1) { archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, - "Padding wrong size: %d should be 1 or 0", - ar->entry_padding); + "Padding wrong size: %ju should be 1 or 0", + (uintmax_t)ar->entry_padding); return (ARCHIVE_WARN); } diff --git a/libarchive/archive_write_set_format_iso9660.c b/libarchive/archive_write_set_format_iso9660.c index fe2d1c96d..75e25125d 100644 --- a/libarchive/archive_write_set_format_iso9660.c +++ b/libarchive/archive_write_set_format_iso9660.c @@ -1298,7 +1298,7 @@ get_str_opt(struct archive_write *a, struct archive_string *s, if (strlen(value) > maxsize) { archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, - "Value is longer than %d characters " + "Value is longer than %zu characters " "for option ``%s''", maxsize, key); return (ARCHIVE_FATAL); } diff --git a/libarchive/archive_write_set_format_mtree.c b/libarchive/archive_write_set_format_mtree.c index 988a7baa6..054cbc143 100644 --- a/libarchive/archive_write_set_format_mtree.c +++ b/libarchive/archive_write_set_format_mtree.c @@ -718,9 +718,9 @@ archive_write_mtree_finish_entry(struct archive_write *a) archive_strcat(str, " type=char"); if ((keys & F_DEV) != 0) { archive_string_sprintf(str, - " device=native,%d,%d", - archive_entry_rdevmajor(entry), - archive_entry_rdevminor(entry)); + " device=native,%ju,%ju", + (uintmax_t)archive_entry_rdevmajor(entry), + (uintmax_t)archive_entry_rdevminor(entry)); } break; case AE_IFBLK: @@ -728,9 +728,9 @@ archive_write_mtree_finish_entry(struct archive_write *a) archive_strcat(str, " type=block"); if ((keys & F_DEV) != 0) { archive_string_sprintf(str, - " device=native,%d,%d", - archive_entry_rdevmajor(entry), - archive_entry_rdevminor(entry)); + " device=native,%ju,%ju", + (uintmax_t)archive_entry_rdevmajor(entry), + (uintmax_t)archive_entry_rdevminor(entry)); } break; case AE_IFDIR: diff --git a/libarchive/archive_write_set_format_shar.c b/libarchive/archive_write_set_format_shar.c index 0348b4eb0..727a6e401 100644 --- a/libarchive/archive_write_set_format_shar.c +++ b/libarchive/archive_write_set_format_shar.c @@ -308,15 +308,15 @@ archive_write_shar_header(struct archive_write *a, struct archive_entry *entry) break; case AE_IFCHR: archive_string_sprintf(&shar->work, - "mknod %s c %d %d\n", shar->quoted_name.s, - archive_entry_rdevmajor(entry), - archive_entry_rdevminor(entry)); + "mknod %s c %ju %ju\n", shar->quoted_name.s, + (uintmax_t)archive_entry_rdevmajor(entry), + (uintmax_t)archive_entry_rdevminor(entry)); break; case AE_IFBLK: archive_string_sprintf(&shar->work, - "mknod %s b %d %d\n", shar->quoted_name.s, - archive_entry_rdevmajor(entry), - archive_entry_rdevminor(entry)); + "mknod %s b %ju %ju\n", shar->quoted_name.s, + (uintmax_t)archive_entry_rdevmajor(entry), + (uintmax_t)archive_entry_rdevminor(entry)); break; default: return (ARCHIVE_WARN); @@ -537,8 +537,7 @@ archive_write_shar_finish_entry(struct archive_write *a) } if ((p = archive_entry_fflags_text(shar->entry)) != NULL) { - archive_string_sprintf(&shar->work, "chflags %s ", - p, archive_entry_pathname(shar->entry)); + archive_string_sprintf(&shar->work, "chflags %s ", p); shar_quote(&shar->work, archive_entry_pathname(shar->entry), 1); archive_strcat(&shar->work, "\n"); diff --git a/libarchive/archive_write_set_format_ustar.c b/libarchive/archive_write_set_format_ustar.c index 5bd038ee2..a76081ce1 100644 --- a/libarchive/archive_write_set_format_ustar.c +++ b/libarchive/archive_write_set_format_ustar.c @@ -168,7 +168,7 @@ archive_write_set_format_ustar(struct archive *_a) /* Basic internal sanity test. */ if (sizeof(template_header) != 512) { - archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Internal: template_header wrong size: %d should be 512", sizeof(template_header)); + archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Internal: template_header wrong size: %zu should be 512", sizeof(template_header)); return (ARCHIVE_FATAL); } -- 2.47.3