From d04e58946eff771bf59db90d7a2301b746141ac4 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Mon, 2 Jun 2014 11:38:18 +0200 Subject: [PATCH] snapshot: add explicit cast to fix warning on x86_64 and switch to unsigned Signed-off-by: Felix Fietkau --- snapshot.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/snapshot.c b/snapshot.c index a7952f3..fe1e537 100644 --- a/snapshot.c +++ b/snapshot.c @@ -150,7 +150,8 @@ snapshot_read(int argc, char **argv) if (argc > 2) { block = atoi(argv[2]); if (block >= (v->size / v->block_size)) { - fprintf(stderr, "invalid block %d > %" PRId64 "\n", block, v->size / v->block_size); + fprintf(stderr, "invalid block %d > %" PRIu64 "\n", + block, (uint64_t) v->size / v->block_size); goto out; } snprintf(file, sizeof(file), "/tmp/snapshot/block%d.tar.gz", block); @@ -178,7 +179,8 @@ snapshot_info(void) if (!v) return -1; - fprintf(stderr, "sectors:\t%" PRId64 ", block_size:\t%dK\n", v->size / v->block_size, v->block_size / 1024); + fprintf(stderr, "sectors:\t%" PRIu64 ", block_size:\t%dK\n", + (uint64_t) v->size / v->block_size, v->block_size / 1024); do { if (volume_read(v, &hdr, block * v->block_size, sizeof(struct file_header))) { fprintf(stderr, "scanning for next free block failed\n"); -- 2.25.1