]> granicus.if.org Git - ipset/commitdiff
ipset: Fix printf format warning
authorNeutron Soutmun <neo.neutron@gmail.com>
Tue, 1 Apr 2014 10:44:52 +0000 (17:44 +0700)
committerJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Mon, 7 Apr 2014 19:49:32 +0000 (21:49 +0200)
Using PRIx32 macro is portable across multiple architectures and
also fix the printf format warning on any architectures that
"%llx" is not refer to 32 bits size.

Signed-off-by: Neutron Soutmun <neo.neutron@gmail.com>
Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
lib/print.c

index f81c074860e9c5e7ec43b0d9ccacd157f26c02dd..a7abdcf0eff0f78153d90e5030a74be18d2b570d 100644 (file)
@@ -13,6 +13,7 @@
 #include <arpa/inet.h>                         /* inet_ntop */
 #include <net/ethernet.h>                      /* ETH_ALEN */
 #include <net/if.h>                            /* IFNAMSIZ */
+#include <inttypes.h>                          /* PRIx macro */
 
 #include <libipset/debug.h>                    /* D() */
 #include <libipset/data.h>                     /* ipset_data_* */
@@ -519,7 +520,7 @@ ipset_print_mark(char *buf, unsigned int len,
        mark = ipset_data_get(data, opt);
        assert(mark);
 
-       size = snprintf(buf, len, "0x%08llx", *mark);
+       size = snprintf(buf, len, "0x%08"PRIx32, *mark);
        SNPRINTF_FAILURE(size, len, offset);
 
        return offset;