diff --git a/cpio/cpio.c b/cpio/cpio.c index 6bc6eb22e..2bf1bfa29 100644 --- a/cpio/cpio.c +++ b/cpio/cpio.c @@ -1206,7 +1206,7 @@ list_item_verbose(struct cpio *cpio, struct archive_entry *entry) else strcpy(date, "invalid mtime"); - fprintf(out, "%s%3d %-8s %-8s %8s %12s %s", + fprintf(out, "%s%3u %-8s %-8s %8s %12s %s", archive_entry_strmode(entry), archive_entry_nlink(entry), uname, gname, size, date, diff --git a/libarchive/archive_read_support_format_zip.c b/libarchive/archive_read_support_format_zip.c index e21048b74..27e6bc051 100644 --- a/libarchive/archive_read_support_format_zip.c +++ b/libarchive/archive_read_support_format_zip.c @@ -2134,15 +2134,15 @@ zipx_ppmd8_init(struct archive_read *a, struct zip *zip) if(order < 2 || restore_method > 2) { archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, - "Invalid parameter set in PPMd8 stream (order=%" PRId32 ", " - "restore=%" PRId32 ")", order, restore_method); + "Invalid parameter set in PPMd8 stream (order=%" PRIu32 ", " + "restore=%" PRIu32 ")", order, restore_method); return (ARCHIVE_FAILED); } /* Allocate the memory needed to properly decompress the file. */ if(!__archive_ppmd8_functions.Ppmd8_Alloc(&zip->ppmd8, mem << 20)) { archive_set_error(&a->archive, ENOMEM, - "Unable to allocate memory for PPMd8 stream: %" PRId32 " bytes", + "Unable to allocate memory for PPMd8 stream: %" PRIu32 " bytes", mem << 20); return (ARCHIVE_FATAL); } diff --git a/libarchive/test/test_write_disk_perms.c b/libarchive/test/test_write_disk_perms.c index 4df9f70bd..77a15d1a3 100644 --- a/libarchive/test/test_write_disk_perms.c +++ b/libarchive/test/test_write_disk_perms.c @@ -216,7 +216,7 @@ DEFINE_TEST(test_write_disk_perms) /* Check original owner. */ assertEqualInt(0, stat("dir_owner", &st)); - failure("dir_owner: st.st_uid=%d", st.st_uid); + failure("dir_owner: st.st_uid=%jd", (intmax_t)st.st_uid); assertEqualInt(st.st_uid, original_uid); /* Shouldn't try to edit the owner when no overwrite option is set. */ assert((ae = archive_entry_new()) != NULL); @@ -230,7 +230,7 @@ DEFINE_TEST(test_write_disk_perms) assertEqualIntA(a, ARCHIVE_OK, archive_write_finish_entry(a)); /* Make sure they're unchanged. */ assertEqualInt(0, stat("dir_owner", &st)); - failure("dir_owner: st.st_uid=%d", st.st_uid); + failure("dir_owner: st.st_uid=%jd", (intmax_t)st.st_uid); assertEqualInt(st.st_uid, original_uid); /* Write a regular file with SUID bit, but don't use _EXTRACT_PERM. */ @@ -475,8 +475,8 @@ DEFINE_TEST(test_write_disk_perms) assertEqualInt(0, stat("file_bad_owner", &st)); failure("file_bad_owner: st.st_mode=%o", st.st_mode); assertEqualInt(st.st_mode & 07777, 0744); - failure("file_bad_owner: st.st_uid=%d getuid()=%d", - st.st_uid, getuid()); + failure("file_bad_owner: st.st_uid=%jd getuid()=%jd", + (intmax_t)st.st_uid, (intmax_t)getuid()); /* The entry had getuid()+1, but because we're * not root, we should not have been able to set that. */ assertEqualInt(st.st_uid, getuid()); diff --git a/tar/util.c b/tar/util.c index a152f3506..e91234c92 100644 --- a/tar/util.c +++ b/tar/util.c @@ -684,7 +684,7 @@ list_item_verbose(struct bsdtar *bsdtar, FILE *out, struct archive_entry *entry) } if (!now) time(&now); - fprintf(out, "%s %d ", + fprintf(out, "%s %u ", archive_entry_strmode(entry), archive_entry_nlink(entry)); diff --git a/test_utils/test_main.c b/test_utils/test_main.c index a823de14d..60b1dc8c6 100644 --- a/test_utils/test_main.c +++ b/test_utils/test_main.c @@ -3536,7 +3536,7 @@ test_summarize(int failed, int skips_num) for (i = 0; i < sizeof(failed_lines)/sizeof(failed_lines[0]); i++) { if (failed_lines[i].count > 1 && !failed_lines[i].skip) - logprintf("%s:%d: Summary: Failed %d times\n", + logprintf("%s:%u: Summary: Failed %d times\n", failed_filename, i, failed_lines[i].count); } /* Clear the failure history for the next file. */