]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-hncp.c
CI: Add warning exemptions for Sun C (suncc-5.14) on Solaris 10
[tcpdump] / print-hncp.c
index 1a30325ff3572d028e1de4863c1d48bb3cd60c49..2dc3147ac4a4c7801ef1906b995dd8ffff8954a1 100644 (file)
@@ -28,9 +28,7 @@
 
 /* \summary: Home Networking Control Protocol (HNCP) printer */
 
-#ifdef HAVE_CONFIG_H
 #include <config.h>
-#endif
 
 #include "netdissect-stdinc.h"
 
@@ -226,7 +224,7 @@ print_prefix(netdissect_options *ndo, const u_char *prefix, u_int max_length)
                ((u_char *)&addr)[plenbytes - 1] &=
                        ((0xff00 >> (plen % 8)) & 0xff);
        }
-       snprintf(buf, sizeof(buf), "%s/%u", ipaddr_string(ndo, (const u_char *)&addr), plen);
+       snprintf(buf, sizeof(buf), "%s/%u", ipaddr_string(ndo, (const u_char *)&addr), plen); /* local buffer, not packet data; don't use GET_IPADDR_STRING() */
         plenbytes += 1 + IPV4_MAPPED_HEADING_LEN;
     } else {
         plenbytes = decode_prefix6(ndo, prefix, max_length, buf, sizeof(buf));
@@ -252,11 +250,11 @@ print_dns_label(netdissect_options *ndo,
             ND_PRINT(".");
         if (length+lab_length > max_length) {
             if (print)
-                (void)nd_printzp(ndo, cp+length, max_length-length, NULL);
+                nd_printjnp(ndo, cp+length, max_length-length);
             break;
         }
         if (print)
-            (void)nd_printzp(ndo, cp+length, lab_length, NULL);
+            nd_printjnp(ndo, cp+length, lab_length);
         length += lab_length;
     }
     if (print)
@@ -586,7 +584,7 @@ hncp_print_rec(netdissect_options *ndo,
             ND_PRINT(" Verdict: %u Fingerprint: %s Common Name: ",
                 GET_U_1(value),
                 format_256(ndo, value + 4));
-            (void)nd_printzp(ndo, value + 36, bodylen - 36, NULL);
+            nd_printjnp(ndo, value + 36, bodylen - 36);
         }
             break;
 
@@ -605,7 +603,7 @@ hncp_print_rec(netdissect_options *ndo,
             ND_PRINT(" M: %u P: %u H: %u L: %u User-agent: ",
                 M, P, H, L
             );
-            (void)nd_printzp(ndo, value + 4, bodylen - 4, NULL);
+            nd_printjnp(ndo, value + 4, bodylen - 4);
         }
             break;
 
@@ -690,7 +688,7 @@ hncp_print_rec(netdissect_options *ndo,
                 print_dns_label(ndo, value+1, bodylen-1, 1);
             } else if (policy == 130) {
                 ND_PRINT("Opaque UTF-8: ");
-                (void)nd_printzp(ndo, value + 1, bodylen - 1, NULL);
+                nd_printjnp(ndo, value + 1, bodylen - 1);
             } else if (policy == 131) {
                 if (bodylen != 1) {
                     nd_print_invalid(ndo);
@@ -820,7 +818,7 @@ hncp_print_rec(netdissect_options *ndo,
             );
             if (l < 64) {
                 ND_PRINT("\"");
-                (void)nd_printzp(ndo, value + 17, l, NULL);
+                nd_printjnp(ndo, value + 17, l);
                 ND_PRINT("\"");
             } else {
                 nd_print_invalid(ndo);