snapshot: add explicit cast to fix warning on x86_64 and switch to unsigned
authorFelix Fietkau <nbd@openwrt.org>
Mon, 2 Jun 2014 09:38:18 +0000 (11:38 +0200)
committerFelix Fietkau <nbd@openwrt.org>
Mon, 2 Jun 2014 09:38:18 +0000 (11:38 +0200)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
snapshot.c

index a7952f3a0af0fabfd08c5cfa073469751b6706e5..fe1e537c46a853273319de69c9eac39404b5a3bd 100644 (file)
@@ -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");