netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ipset: Fix printf format warning
@ 2014-04-01 10:44 Neutron Soutmun
  2014-04-07 19:52 ` Jozsef Kadlecsik
  0 siblings, 1 reply; 2+ messages in thread
From: Neutron Soutmun @ 2014-04-01 10:44 UTC (permalink / raw)
  To: netfilter-devel; +Cc: kadlec

[-- Attachment #1: Type: text/plain, Size: 998 bytes --]

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>
---
 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 #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ipset: Fix printf format warning
  2014-04-01 10:44 [PATCH] ipset: Fix printf format warning Neutron Soutmun
@ 2014-04-07 19:52 ` Jozsef Kadlecsik
  0 siblings, 0 replies; 2+ messages in thread
From: Jozsef Kadlecsik @ 2014-04-07 19:52 UTC (permalink / raw)
  To: Neutron Soutmun; +Cc: netfilter-devel

On Tue, 1 Apr 2014, Neutron Soutmun wrote:

> 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.

Patch is applied, thanks.

Best regards,
Jozsef
-
E-mail  : kadlec@blackhole.kfki.hu, kadlecsik.jozsef@wigner.mta.hu
PGP key : http://www.kfki.hu/~kadlec/pgp_public_key.txt
Address : Wigner Research Centre for Physics, Hungarian Academy of Sciences
          H-1525 Budapest 114, POB. 49, Hungary

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-04-07 19:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-01 10:44 [PATCH] ipset: Fix printf format warning Neutron Soutmun
2014-04-07 19:52 ` Jozsef Kadlecsik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).