X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/ba8936b39b0ce2ff02f3aeb307df4c27657652d8..e7cfa5e63a27e6fbb75e0bbd151af2c7d0d222e9:/print-telnet.c diff --git a/print-telnet.c b/print-telnet.c index 3bfb19a2..f2ff1389 100644 --- a/print-telnet.c +++ b/print-telnet.c @@ -397,7 +397,7 @@ telnet_parse(netdissect_options *ndo, const u_char *sp, u_int length, int print) if (length < 1) \ goto pktend; \ ND_TCHECK_1(sp); \ - c = EXTRACT_U_1(sp); \ + c = GET_U_1(sp); \ sp++; \ length--; \ } while (0) @@ -439,12 +439,12 @@ telnet_parse(netdissect_options *ndo, const u_char *sp, u_int length, int print) p = sp; while (length > (u_int)(p + 1 - sp)) { ND_TCHECK_2(p); - if (EXTRACT_U_1(p) == IAC && EXTRACT_U_1(p + 1) == SE) + if (GET_U_1(p) == IAC && GET_U_1(p + 1) == SE) break; p++; } ND_TCHECK_1(p); - if (EXTRACT_U_1(p) != IAC) + if (GET_U_1(p) != IAC) goto pktend; switch (x) { @@ -497,7 +497,7 @@ telnet_parse(netdissect_options *ndo, const u_char *sp, u_int length, int print) } done: - return sp - osp; + return (int)(sp - osp); trunc: nd_print_trunc(ndo); @@ -517,7 +517,7 @@ telnet_print(netdissect_options *ndo, const u_char *sp, u_int length) osp = sp; ND_TCHECK_1(sp); - while (length > 0 && EXTRACT_U_1(sp) == IAC) { + while (length > 0 && GET_U_1(sp) == IAC) { /* * Parse the Telnet command without printing it, * to determine its length. @@ -532,7 +532,7 @@ telnet_print(netdissect_options *ndo, const u_char *sp, u_int length) if (ndo->ndo_Xflag && 2 < ndo->ndo_vflag) { if (first) ND_PRINT("\nTelnet:"); - hex_print_with_offset(ndo, "\n", sp, l, sp - osp); + hex_print_with_offset(ndo, "\n", sp, l, (u_int)(sp - osp)); if (l > 8) ND_PRINT("\n\t\t\t\t"); else