summaryrefslogtreecommitdiffstats
path: root/usr.sbin/tcpdump/tcpdump.c
diff options
context:
space:
mode:
authorprocter <procter@openbsd.org>2020-01-24 22:46:36 +0000
committerprocter <procter@openbsd.org>2020-01-24 22:46:36 +0000
commitf96bb33f4775ce2a1279cb96ebaecb010eb3bdc3 (patch)
tree9b2ab0af0e72e725c026e33cb8dd0226e3808486 /usr.sbin/tcpdump/tcpdump.c
parentAdd FILES sections; OK espie@ solene@. (diff)
downloadwireguard-openbsd-f96bb33f4775ce2a1279cb96ebaecb010eb3bdc3.tar.xz
wireguard-openbsd-f96bb33f4775ce2a1279cb96ebaecb010eb3bdc3.zip
- (void)printf() -> printf(); the cast adds clutter for little value.
- fprintf(stdout, ...) -> printf() - fputs(x, stdout) -> printf(); for consistency. fputs is twice as fast on atom x5-Z8300@1.44GHz but Amdahl sees a pure printf tcpdump only 2% slower than a pure fputs (for constant strings) tcpdump to /dev/null across a 20MB/~170k packet pcap file. ok dlg@ for fputs and ok tedu@ krw@ deraadt@ a2k19 for the rest
Diffstat (limited to 'usr.sbin/tcpdump/tcpdump.c')
-rw-r--r--usr.sbin/tcpdump/tcpdump.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/usr.sbin/tcpdump/tcpdump.c b/usr.sbin/tcpdump/tcpdump.c
index 7664d8c4b3c..34d7de738ad 100644
--- a/usr.sbin/tcpdump/tcpdump.c
+++ b/usr.sbin/tcpdump/tcpdump.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcpdump.c,v 1.91 2019/06/28 13:32:51 deraadt Exp $ */
+/* $OpenBSD: tcpdump.c,v 1.92 2020/01/24 22:46:37 procter Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997
@@ -656,14 +656,14 @@ default_print_unaligned(const u_char *cp, u_int length)
i = 0;
while (--nshorts >= 0) {
if ((i++ % 8) == 0)
- (void)printf("\n\t\t\t");
+ printf("\n\t\t\t");
s = *cp++;
- (void)printf(" %02x%02x", s, *cp++);
+ printf(" %02x%02x", s, *cp++);
}
if (length & 1) {
if ((i % 8) == 0)
- (void)printf("\n\t\t\t");
- (void)printf(" %02x", *cp);
+ printf("\n\t\t\t");
+ printf(" %02x", *cp);
}
}
}
@@ -692,13 +692,13 @@ default_print(const u_char *bp, u_int length)
i = 0;
while (--nshorts >= 0) {
if ((i++ % 8) == 0)
- (void)printf("\n\t\t\t");
- (void)printf(" %04x", ntohs(*sp++));
+ printf("\n\t\t\t");
+ printf(" %04x", ntohs(*sp++));
}
if (length & 1) {
if ((i % 8) == 0)
- (void)printf("\n\t\t\t");
- (void)printf(" %02x", *(u_char *)sp);
+ printf("\n\t\t\t");
+ printf(" %02x", *(u_char *)sp);
}
}
}