summaryrefslogtreecommitdiffstats
path: root/usr.sbin/tcpdump/tcpdump.c
diff options
context:
space:
mode:
authornaddy <naddy@openbsd.org>2015-07-12 19:58:00 +0000
committernaddy <naddy@openbsd.org>2015-07-12 19:58:00 +0000
commitd84180e802fe522d7893fc82cfa286b9b633d2d2 (patch)
treefaf26ee6315272ff60bfb4c1258f97119fc26bc4 /usr.sbin/tcpdump/tcpdump.c
parentUse memset instead of bzero for better portability. (diff)
downloadwireguard-openbsd-d84180e802fe522d7893fc82cfa286b9b633d2d2.tar.xz
wireguard-openbsd-d84180e802fe522d7893fc82cfa286b9b633d2d2.zip
For ASCII dumps, tighten printable characters. \v and \f aren't.
ok semarie@ sthen@
Diffstat (limited to 'usr.sbin/tcpdump/tcpdump.c')
-rw-r--r--usr.sbin/tcpdump/tcpdump.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.sbin/tcpdump/tcpdump.c b/usr.sbin/tcpdump/tcpdump.c
index d96658b356c..0a751a4d36a 100644
--- a/usr.sbin/tcpdump/tcpdump.c
+++ b/usr.sbin/tcpdump/tcpdump.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcpdump.c,v 1.70 2015/04/18 18:28:38 deraadt Exp $ */
+/* $OpenBSD: tcpdump.c,v 1.71 2015/07/12 19:58:00 naddy Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997
@@ -603,8 +603,10 @@ default_print_ascii(const u_char *cp, unsigned int length)
printf("\n");
for (i = 0; i < length; i++) {
c = cp[i];
- c = isprint(c) || isspace(c) ? c : '.';
- putchar(c);
+ if (isprint(c) || c == '\t' || c == '\n' || c == '\r')
+ putchar(c);
+ else
+ putchar('.');
}
}