]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-ascii.c
CI: Add warning exemptions for Sun C (suncc-5.14) on Solaris 10
[tcpdump] / print-ascii.c
index ce97444554d0a5a3796c4b281359a6616e14f2ed..f504d2f7f0cfb0305b3d9d51a07447f4a8694b38 100644 (file)
@@ -38,9 +38,7 @@
 
 /* \summary: ASCII packet dump printer */
 
-#ifdef HAVE_CONFIG_H
 #include <config.h>
-#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 */