summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeutron Soutmun <neo.neutron@gmail.com>2021-01-18 11:58:30 +0700
committerJozsef Kadlecsik <kadlec@netfilter.org>2021-01-19 09:00:10 +0100
commit423a309ca8df5747e41a28ddce33d61fe64a2844 (patch)
treeb1454030801ab7fdac7479e1390fc04bff558251
parentda6242e1758381135b15c4c4e9f170340f50e128 (diff)
ipset: fix print format warning
* Use PRIx64 for portablility over various architectures. * The format string for the 64bit number printing is incorrect, the `%` sign is missing. * The force types casting over the uint32_t and uint64_t are unnecessary which warned by the compiler on different architecture. Signed-off-by: Neutron Soutmun <neo.neutron@gmail.com> Signed-off-by: Jozsef Kadlecsik <kadlec@netfilter.org>
-rw-r--r--lib/print.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/print.c b/lib/print.c
index 0d86a98..a7ffd81 100644
--- a/lib/print.c
+++ b/lib/print.c
@@ -431,10 +431,10 @@ ipset_print_hexnumber(char *buf, unsigned int len,
*(const uint16_t *) number);
else if (maxsize == sizeof(uint32_t))
return snprintf(buf, len, "0x%08"PRIx32,
- (long unsigned) *(const uint32_t *) number);
+ *(const uint32_t *) number);
else if (maxsize == sizeof(uint64_t))
- return snprintf(buf, len, "0x016lx",
- (long long unsigned) *(const uint64_t *) number);
+ return snprintf(buf, len, "0x%016"PRIx64,
+ *(const uint64_t *) number);
else
assert(0);
return 0;