[PATCH] ipset: Fix printf format warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 lib/print.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/print.c b/lib/print.c
index f81c074..a7abdcf 100644
--- a/lib/print.c
+++ b/lib/print.c
@@ -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;
-- 
1.9.1

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux