X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/0d4083ee8687a9f6578e26a1407bd9f2a9d27885..HEAD:/print-ascii.c diff --git a/print-ascii.c b/print-ascii.c index ce974445..f504d2f7 100644 --- a/print-ascii.c +++ b/print-ascii.c @@ -38,9 +38,7 @@ /* \summary: ASCII packet dump printer */ -#ifdef HAVE_CONFIG_H #include -#endif #include "netdissect-stdinc.h" @@ -73,7 +71,7 @@ ascii_print(netdissect_options *ndo, truncated = TRUE; } ND_PRINT("\n"); - while (length > 0) { + while (length != 0) { s = GET_U_1(cp); cp++; length--; @@ -214,22 +212,3 @@ hex_print(netdissect_options *ndo, { hex_print_with_offset(ndo, indent, cp, length, 0); } - -#ifdef MAIN -int -main(int argc, char *argv[]) -{ - hex_print("\n\t", "Hello, World!\n", 14); - printf("\n"); - hex_and_ascii_print("\n\t", "Hello, World!\n", 14); - printf("\n"); - ascii_print("Hello, World!\n", 14); - printf("\n"); -#define TMSG "Now is the winter of our discontent...\n" - hex_print_with_offset("\n\t", TMSG, sizeof(TMSG) - 1, 0x100); - printf("\n"); - hex_and_ascii_print_with_offset("\n\t", TMSG, sizeof(TMSG) - 1, 0x100); - printf("\n"); - exit(0); -} -#endif /* MAIN */