summaryrefslogtreecommitdiff
path: root/print-ascii.c
diff options
context:
space:
mode:
authorFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2018-06-01 22:06:42 +0200
committerFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2018-06-01 22:25:17 +0200
commit5fe61e70f1afddf691b6a944dcd1e369194259ec (patch)
treec3e525c4bdf31b3e693a0c6e02914cfbd4019dc9 /print-ascii.c
parentb4503d7c317c170842c487f852dc4dcd63eff084 (diff)
downloadtcpdump-5fe61e70f1afddf691b6a944dcd1e369194259ec.tar.gz
Simplify some expressions
In the equality case, the difference is also zero.
Diffstat (limited to 'print-ascii.c')
-rw-r--r--print-ascii.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/print-ascii.c b/print-ascii.c
index 83b0c38f..8c12b4fd 100644
--- a/print-ascii.c
+++ b/print-ascii.c
@@ -65,7 +65,7 @@ ascii_print(netdissect_options *ndo,
u_char s;
ndo->ndo_protocol = "ascii";
- caplength = (ndo->ndo_snapend >= cp) ? ndo->ndo_snapend - cp : 0;
+ caplength = (ndo->ndo_snapend > cp) ? ndo->ndo_snapend - cp : 0;
if (length > caplength)
length = caplength;
ND_PRINT("\n");
@@ -106,7 +106,7 @@ hex_and_ascii_print_with_offset(netdissect_options *ndo, const char *ident,
char hexstuff[HEXDUMP_SHORTS_PER_LINE*HEXDUMP_HEXSTUFF_PER_SHORT+1], *hsp;
char asciistuff[ASCII_LINELENGTH+1], *asp;
- caplength = (ndo->ndo_snapend >= cp) ? ndo->ndo_snapend - cp : 0;
+ caplength = (ndo->ndo_snapend > cp) ? ndo->ndo_snapend - cp : 0;
if (length > caplength)
length = caplength;
nshorts = length / sizeof(u_short);
@@ -168,7 +168,7 @@ hex_print_with_offset(netdissect_options *ndo,
u_int i, s;
int nshorts;
- caplength = (ndo->ndo_snapend >= cp) ? ndo->ndo_snapend - cp : 0;
+ caplength = (ndo->ndo_snapend > cp) ? ndo->ndo_snapend - cp : 0;
if (length > caplength)
length = caplength;
nshorts = (u_int) length / sizeof(u_short);