diff options
author | Guy Harris <guy@alum.mit.edu> | 2019-04-18 10:13:49 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2019-04-18 10:13:49 -0700 |
commit | 07a7f33ba3ff346b9ce31772645a06980baca907 (patch) | |
tree | 111a5a89cefb1c27e83b1aa4fb7a95e7c6163b8d /print-telnet.c | |
parent | 7c30120f52c22c1dd971431383ad2df8ca1a12c4 (diff) | |
download | tcpdump-07a7f33ba3ff346b9ce31772645a06980baca907.tar.gz |
Fix some narrowing warnings on LP64/LLP64 platforms.
Add a ND_BYTES_AVAILABLE_AFTER() macro to find the number of bytes
available in the captured data, starting at the byte pointed to by the
argument. It returns a u_int rather than a ptrdiff_t, so it'll be
32 bits on LP64 and LLP64 platforms as well as on ILP32 platforms. Use
that macro.
Make size-of-buffer arguments size_t.
Cast some size_t and ptrdiff_t values to u_int or int.
Diffstat (limited to 'print-telnet.c')
-rw-r--r-- | print-telnet.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/print-telnet.c b/print-telnet.c index e6223d9b..f2ff1389 100644 --- a/print-telnet.c +++ b/print-telnet.c @@ -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); @@ -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 |