From: Francois-Xavier Le Bail Date: Thu, 30 Nov 2017 22:02:24 +0000 (+0100) Subject: Use more the EXTRACT_U_1() macro (35/n) X-Git-Tag: tcpdump-4.99-bp~1694 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/97de8ca7bd0e1a64714dc2819d65ee0863b1d6d1 Use more the EXTRACT_U_1() macro (35/n) In some safeputchar() calls, *(p). --- diff --git a/print-fr.c b/print-fr.c index 94587ac0..c8415e12 100644 --- a/print-fr.c +++ b/print-fr.c @@ -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; } diff --git a/print-icmp6.c b/print-icmp6.c index f0377ce4..761b3779 100644 --- a/print-icmp6.c +++ b/print-icmp6.c @@ -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,"\"")); diff --git a/print-ldp.c b/print-ldp.c index 5a7608b9..1131fe55 100644 --- a/print-ldp.c +++ b/print-ldp.c @@ -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: diff --git a/print-syslog.c b/print-syslog.c index 0bad348c..15720fa2 100644 --- a/print-syslog.c +++ b/print-syslog.c @@ -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)