ipset: Fix printf format warning
Subsystems (2)
PATCH 1/1 ipset: Fix printf format warning
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 <[email protected]>
--- lib/print.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
lib/print.c +2 -1
@@ -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;
Signature · 1 line
1.9.1
Quoted 3 lines · Neutron Soutmun
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 : [email protected], [email protected] 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