nfq: remove `0x' from HW protocol in output of nfq_snprintf_xml()
authorPablo Neira Ayuso <pablo@netfilter.org>
Sun, 11 Jul 2010 13:08:40 +0000 (15:08 +0200)
committerr.kubiak <r.kubiak@samsung.com>
Mon, 16 Nov 2015 13:12:06 +0000 (14:12 +0100)
This patch removes the prefix `0x' of the HW protocol.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/libnetfilter_queue.c

index 7269042..97bb49e 100644 (file)
@@ -1087,7 +1087,7 @@ int nfq_snprintf_xml(char *buf, size_t rem, struct nfq_data *tb, int flags)
                if (hwph && (flags & NFQ_XML_HW)) {
                        int i, hlen = ntohs(hwph->hw_addrlen);
 
-                       size = snprintf(buf + offset, rem, "<hw><proto>0x%04x"
+                       size = snprintf(buf + offset, rem, "<hw><proto>%04x"
                                                           "</proto>",
                                        ntohs(ph->hw_protocol));
                        SNPRINTF_FAILURE(size, rem, offset, len);
@@ -1104,7 +1104,7 @@ int nfq_snprintf_xml(char *buf, size_t rem, struct nfq_data *tb, int flags)
                        size = snprintf(buf + offset, rem, "</src></hw>");
                        SNPRINTF_FAILURE(size, rem, offset, len);
                } else if (flags & NFQ_XML_HW) {
-                       size = snprintf(buf + offset, rem, "<hw><proto>0x%04x"
+                       size = snprintf(buf + offset, rem, "<hw><proto>%04x"
                                                    "</proto></hw>",
                                 ntohs(ph->hw_protocol));
                        SNPRINTF_FAILURE(size, rem, offset, len);