Merge pull request #2901 from stoeckmann/cpio_llp64
tools: Cast int64_t to long long in printf
(cherry picked from commit b5f1272333)
This commit is contained in:
1 parent
3a9249b4ee
commit
ae03a76592
2 files changed
+7
-7
No files matched your search
+3
-3
@@ -638,7 +638,7 @@ mode_out(struct cpio *cpio)
|
||||
int64_t blocks =
|
||||
(archive_filter_bytes(cpio->archive, 0) + 511)
|
||||
/ 512;
|
||||
fprintf(stderr, "%lu %s\n", (unsigned long)blocks,
|
||||
fprintf(stderr, "%lld %s\n", (long long)blocks,
|
||||
blocks == 1 ? "block" : "blocks");
|
||||
}
|
||||
archive_write_free(cpio->archive);
|
||||
@@ -1040,7 +1040,7 @@ mode_in(struct cpio *cpio)
|
||||
if (!cpio->quiet) {
|
||||
int64_t blocks = (archive_filter_bytes(a, 0) + 511)
|
||||
/ 512;
|
||||
fprintf(stderr, "%lu %s\n", (unsigned long)blocks,
|
||||
fprintf(stderr, "%lld %s\n", (long long)blocks,
|
||||
blocks == 1 ? "block" : "blocks");
|
||||
}
|
||||
archive_read_free(a);
|
||||
@@ -1125,7 +1125,7 @@ mode_list(struct cpio *cpio)
|
||||
if (!cpio->quiet) {
|
||||
int64_t blocks = (archive_filter_bytes(a, 0) + 511)
|
||||
/ 512;
|
||||
fprintf(stderr, "%lu %s\n", (unsigned long)blocks,
|
||||
fprintf(stderr, "%lld %s\n", (long long)blocks,
|
||||
blocks == 1 ? "block" : "blocks");
|
||||
}
|
||||
archive_read_free(a);
|
||||
|
||||
+4
-4
@@ -715,8 +715,8 @@ list_item_verbose(struct bsdtar *bsdtar, FILE *out, struct archive_entry *entry)
|
||||
/* Use uname if it's present, else uid. */
|
||||
p = archive_entry_uname(entry);
|
||||
if ((p == NULL) || (*p == '\0')) {
|
||||
snprintf(tmp, sizeof(tmp), "%lu ",
|
||||
(unsigned long)archive_entry_uid(entry));
|
||||
snprintf(tmp, sizeof(tmp), "%lld ",
|
||||
(long long)archive_entry_uid(entry));
|
||||
p = tmp;
|
||||
}
|
||||
w = strlen(p);
|
||||
@@ -730,8 +730,8 @@ list_item_verbose(struct bsdtar *bsdtar, FILE *out, struct archive_entry *entry)
|
||||
fprintf(out, "%s", p);
|
||||
w = strlen(p);
|
||||
} else {
|
||||
snprintf(tmp, sizeof(tmp), "%lu",
|
||||
(unsigned long)archive_entry_gid(entry));
|
||||
snprintf(tmp, sizeof(tmp), "%lld",
|
||||
(long long)archive_entry_gid(entry));
|
||||
w = strlen(tmp);
|
||||
fprintf(out, "%s", tmp);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user