]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-ascii.c
Merge pull request #704 from nmap/win32-isatty
[tcpdump] / print-ascii.c
index 83b0c38f65ed36b6228c3ac208b80a9d37494ac1..8c12b4fd87f650a32b8876913d07a68297454971 100644 (file)
@@ -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);