Suppress a printf warning by using the proper format.
authorMalte S. Stretz <mss@apache.org>
Tue, 31 May 2011 23:45:26 +0000 (01:45 +0200)
committerEmil Mikulic <emikulic@gmail.com>
Tue, 21 Jun 2011 12:22:28 +0000 (22:22 +1000)
darkstat.c

index 75fa5f0..4513bd2 100644 (file)
@@ -24,6 +24,7 @@
 
 #include <assert.h>
 #include <errno.h>
+#include <inttypes.h>
 #include <signal.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -364,7 +365,11 @@ run_from_capfile(void)
    if (export_fn != NULL) db_export(export_fn);
    hosts_db_free();
    graph_free();
-   verbosef("Total packets: %qu, bytes: %qu",
+#ifndef PRIu64
+#warning "PRIu64 is not defined, using qu instead"
+#define PRIu64 "qu"
+#endif
+   verbosef("Total packets: %"PRIu64", bytes: %"PRIu64,
       acct_total_packets, acct_total_bytes);
 }