X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/49b23c5a9b0198bb382dcf43c458d46fcf2fa809..c56f25c54b87b3edaced56578721c72d7ca9795d:/print-ascii.c diff --git a/print-ascii.c b/print-ascii.c index 4ef38a17..2e5812e4 100644 --- a/print-ascii.c +++ b/print-ascii.c @@ -46,6 +46,7 @@ #include #include "netdissect.h" +#include "extract.h" #define ASCII_LINELENGTH 300 #define HEXDUMP_BYTES_PER_LINE 16 @@ -66,7 +67,8 @@ ascii_print(netdissect_options *ndo, length = caplength; ND_PRINT((ndo, "\n")); while (length > 0) { - s = *cp++; + s = EXTRACT_U_1(cp); + cp++; length--; if (s == '\r') { /* @@ -78,7 +80,7 @@ ascii_print(netdissect_options *ndo, * * In the middle of a line, just print a '.'. */ - if (length > 1 && *cp != '\n') + if (length > 1 && EXTRACT_U_1(cp) != '\n') ND_PRINT((ndo, ".")); } else { if (!ND_ISGRAPH(s) &&