From: Neutron Soutmun <neo.neutron@gmail.com>
To: netfilter-devel@vger.kernel.org
Cc: kadlec@blackhole.kfki.hu
Subject: [PATCH] ipset: Fix printf format warning
Date: Tue, 1 Apr 2014 17:44:52 +0700 [thread overview]
Message-ID: <20140401104452.GA2110@nitrogen.neutroncom.local> (raw)
[-- 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 --]
next reply other threads:[~2014-04-01 10:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-01 10:44 Neutron Soutmun [this message]
2014-04-07 19:52 ` [PATCH] ipset: Fix printf format warning Jozsef Kadlecsik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140401104452.GA2110@nitrogen.neutroncom.local \
--to=neo.neutron@gmail.com \
--cc=kadlec@blackhole.kfki.hu \
--cc=netfilter-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).