X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/ee68aa36460d7efeca48747f33b7f2adc0900bfb..675f67a20b0a94eef8288b0016f959a1597615cc:/print-openflow-1.0.c diff --git a/print-openflow-1.0.c b/print-openflow-1.0.c index 12051992..4cf766bc 100644 --- a/print-openflow-1.0.c +++ b/print-openflow-1.0.c @@ -697,12 +697,11 @@ static const char * vlan_str(const uint16_t vid) { static char buf[sizeof("65535 (bogus)")]; - const char *fmt; if (vid == OFP_VLAN_NONE) return "NONE"; - fmt = (vid > 0 && vid < 0x0fff) ? "%u" : "%u (bogus)"; - nd_snprintf(buf, sizeof(buf), fmt, vid); + snprintf(buf, sizeof(buf), "%u%s", vid, + (vid > 0 && vid < 0x0fff) ? "" : " (bogus)"); return buf; } @@ -710,7 +709,8 @@ static const char * pcp_str(const uint8_t pcp) { static char buf[sizeof("255 (bogus)")]; - nd_snprintf(buf, sizeof(buf), pcp <= 7 ? "%u" : "%u (bogus)", pcp); + snprintf(buf, sizeof(buf), "%u%s", pcp, + pcp <= 7 ? "" : " (bogus)"); return buf; } @@ -1128,7 +1128,7 @@ of10_packet_data_print(netdissect_options *ndo, ND_TCHECK_LEN(cp, len); ndo->ndo_vflag -= 3; ND_PRINT(", frame decoding below\n"); - ether_print(ndo, cp, len, ndo->ndo_snapend - cp, NULL, NULL); + ether_print(ndo, cp, len, ND_BYTES_AVAILABLE_AFTER(cp), NULL, NULL); ndo->ndo_vflag += 3; return cp + len; @@ -1351,7 +1351,7 @@ of10_match_print(netdissect_options *ndo, uint32_t wildcards; uint16_t dl_type; uint8_t nw_proto; - u_char nw_bits; + u_int nw_bits; const char *field_name; /* wildcards */