From f95e8598af7e3a1641166b4e6be31b87d4690326 Mon Sep 17 00:00:00 2001 From: Giuseppe Longo Date: Fri, 5 Jul 2013 10:06:28 +0200 Subject: src: improve default text output This patch improves default plain text output by mimicing the default output of libnl-nft. While at it, several %lu has been translated to use %"PRIu64" for correctness. [ I have added the policy to string translation --pablo ] Signed-off-by: Giuseppe Longo Signed-off-by: Pablo Neira Ayuso --- src/expr/counter.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/expr/counter.c') diff --git a/src/expr/counter.c b/src/expr/counter.c index 665fa14..171088d 100644 --- a/src/expr/counter.c +++ b/src/expr/counter.c @@ -13,6 +13,7 @@ #include #include #include +#include #include @@ -175,13 +176,13 @@ nft_rule_expr_counter_snprintf(char *buf, size_t len, uint32_t type, switch(type) { case NFT_RULE_O_DEFAULT: - return snprintf(buf, len, "pkts=%lu bytes=%lu ", + return snprintf(buf, len, "pkts %"PRIu64" bytes %"PRIu64" ", ctr->pkts, ctr->bytes); case NFT_RULE_O_XML: - return snprintf(buf, len, "%lu%lu", + return snprintf(buf, len, "%"PRIu64"%"PRIu64"", ctr->pkts, ctr->bytes); case NFT_RULE_O_JSON: - return snprintf(buf, len, "\"pkts\" : %lu, \"bytes\" : %lu", + return snprintf(buf, len, "\"pkts\" : %"PRIu64", \"bytes\" : %"PRIu64"", ctr->pkts, ctr->bytes); default: break; -- cgit v1.2.3