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-lisp.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-lisp.c')
-rw-r--r-- | print-lisp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/print-lisp.c b/print-lisp.c index a7d088d4..5c6825ae 100644 --- a/print-lisp.c +++ b/print-lisp.c @@ -381,7 +381,7 @@ lisp_print(netdissect_options *ndo, const u_char *bp, u_int length) /* Check if packet isn't over yet */ if (packet_iterator + packet_offset < ndo->ndo_snapend) { hex_print_with_offset(ndo, "\n Data: ", packet_iterator + packet_offset, - (ndo->ndo_snapend - (packet_iterator + packet_offset)), 0); + ND_BYTES_AVAILABLE_AFTER(packet_iterator + packet_offset), 0); } } return; |