]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Use more the EXTRACT_U_1() macro (35/n)
authorFrancois-Xavier Le Bail <[email protected]>
Thu, 30 Nov 2017 22:02:24 +0000 (23:02 +0100)
committerFrancois-Xavier Le Bail <[email protected]>
Thu, 30 Nov 2017 22:08:07 +0000 (23:08 +0100)
In some safeputchar() calls, *(p).

print-fr.c
print-icmp6.c
print-ldp.c
print-syslog.c

index 94587ac004c0a28e875ee3d135ab4ca672ed74b7..c8415e12c8b6f27dcf734d651fb8384e3d9783ad 100644 (file)
@@ -500,7 +500,7 @@ mfr_print(netdissect_options *ndo,
             case MFR_CTRL_IE_LINK_ID:
                 for (idx = 0; idx < ie_len && idx < MFR_ID_STRING_MAXLEN; idx++) {
                     if (*(tptr+idx) != 0) /* don't print null termination */
-                        safeputchar(ndo, *(tptr + idx));
+                        safeputchar(ndo, EXTRACT_U_1(tptr + idx));
                     else
                         break;
                 }
index f0377ce43ebd1708690bf6683dc1ba9118818878..761b3779e6f2c75b9744ffa97626120b77be1f8e 100644 (file)
@@ -1544,7 +1544,7 @@ dnsname_print(netdissect_options *ndo, const u_char *cp, const u_char *ep)
                                break;
                        }
                        while (i-- && cp < ep) {
-                               safeputchar(ndo, *cp);
+                               safeputchar(ndo, EXTRACT_U_1(cp));
                                cp++;
                        }
                        if (cp + 1 < ep && EXTRACT_U_1(cp))
@@ -1666,7 +1666,7 @@ icmp6_nodeinfo_print(netdissect_options *ndo, u_int icmp6len, const u_char *bp,
                                cp++;
                                ND_PRINT((ndo,", \""));
                                while (cp < ep) {
-                                       safeputchar(ndo, *cp);
+                                       safeputchar(ndo, EXTRACT_U_1(cp));
                                        cp++;
                                }
                                ND_PRINT((ndo,"\""));
@@ -1764,7 +1764,7 @@ icmp6_nodeinfo_print(netdissect_options *ndo, u_int icmp6len, const u_char *bp,
                                cp++;
                                ND_PRINT((ndo,", \""));
                                while (cp < ep) {
-                                       safeputchar(ndo, *cp);
+                                       safeputchar(ndo, EXTRACT_U_1(cp));
                                        cp++;
                                }
                                ND_PRINT((ndo,"\""));
index 5a7608b938dcb98e27e1b1c04eab28da3a34963b..1131fe55c47533536ef35cb469c2fc82659c0e82 100644 (file)
@@ -441,7 +441,7 @@ ldp_tlv_print(netdissect_options *ndo,
                 case LDP_FEC_MARTINI_IFPARM_DESC:
                     ND_PRINT((ndo, ": "));
                     for (idx = 2; idx < vc_info_tlv_len; idx++)
-                        safeputchar(ndo, *(tptr + idx));
+                        safeputchar(ndo, EXTRACT_U_1(tptr + idx));
                     break;
 
                 case LDP_FEC_MARTINI_IFPARM_VCCV:
index 0bad348c0478b71b1caf6421664568f5d6597a85..15720fa2b6cda5099fbc4af276a38c73cc0c4f86 100644 (file)
@@ -133,7 +133,7 @@ syslog_print(netdissect_options *ndo,
     /* print the syslog text in verbose mode */
     for (; msg_off < len; msg_off++) {
         ND_TCHECK_1(pptr + msg_off);
-        safeputchar(ndo, *(pptr + msg_off));
+        safeputchar(ndo, EXTRACT_U_1(pptr + msg_off));
     }
 
     if (ndo->ndo_vflag > 1)