ubase

suckless linux base utils
git clone git://git.2f30.org/ubase
Log | Files | Refs | README | LICENSE

commit a4e8cf6664d63b86349a776b19e2f5b21873e8b5
parent 4b58a3fcbedf1ed4420522ec549dd1d0af0f7fd2
Author: sin <sin@2f30.org>
Date:   Wed,  4 Jun 2014 13:17:57 +0100

Use the macros from inttypes.h to properly print uint64_t

Diffstat:
Mdd.c | 10+++++++---
1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/dd.c b/dd.c @@ -8,6 +8,7 @@ */ #include <errno.h> #include <fcntl.h> +#include <inttypes.h> #include <signal.h> #include <stdio.h> #include <string.h> @@ -201,9 +202,12 @@ print_stat(const struct dd_config *ddc) if (ddc->quiet) return; - fprintf(stderr, "%lu records in\n%lu records out\n%lu bytes (%lu MB) copied, %lu s, %f MB/s [%f mB/s]\n", - ddc->rec_in, ddc->rec_out, ddc->b_out, ddc->b_out/(1<<20), - ddc->t_end - ddc->t_start, + fprintf(stderr, "%"PRIu64" records in\n", ddc->rec_in); + fprintf(stderr, "%"PRIu64" records out\n", ddc->rec_out); + fprintf(stderr, "%"PRIu64" bytes (%"PRIu64" MB) copied", ddc->b_out, + ddc->b_out/(1<<20)); + fprintf(stderr, ", %lu s, %f MB/s [%f mB/s]\n", + (unsigned long)ddc->t_end - ddc->t_start, ((double)(ddc->b_out/(1<<20)))/(ddc->t_end - ddc->t_start), ((double)(ddc->b_out/(1000*1000)))/(ddc->t_end - ddc->t_start)); }