diff options
author | procter <procter@openbsd.org> | 2020-01-24 22:46:36 +0000 |
---|---|---|
committer | procter <procter@openbsd.org> | 2020-01-24 22:46:36 +0000 |
commit | f96bb33f4775ce2a1279cb96ebaecb010eb3bdc3 (patch) | |
tree | 9b2ab0af0e72e725c026e33cb8dd0226e3808486 /usr.sbin/tcpdump/print-ppp.c | |
parent | Add FILES sections; OK espie@ solene@. (diff) | |
download | wireguard-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/print-ppp.c')
-rw-r--r-- | usr.sbin/tcpdump/print-ppp.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/tcpdump/print-ppp.c b/usr.sbin/tcpdump/print-ppp.c index 78edc46a073..21f5d154847 100644 --- a/usr.sbin/tcpdump/print-ppp.c +++ b/usr.sbin/tcpdump/print-ppp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-ppp.c,v 1.33 2019/04/05 00:57:59 dlg Exp $ */ +/* $OpenBSD: print-ppp.c,v 1.34 2020/01/24 22:46:37 procter Exp $ */ /* * Copyright (c) 1990, 1991, 1993, 1994, 1995, 1996, 1997 @@ -1224,7 +1224,7 @@ ppp_ether_if_print(u_char *user, const struct pcap_pkthdr *h, const u_char *p) } if (length < pppoe_len) { - (void)printf(" truncated-pppoe - %d bytes missing!", + printf(" truncated-pppoe - %d bytes missing!", pppoe_len - length); pppoe_len = length; } @@ -1285,7 +1285,7 @@ pppoe_if_print(u_short ethertype, const u_char *p, u_int length, u_int l) length -= sizeof(struct pppoe_header); if (length < pppoe_len) { - (void)printf(" truncated-pppoe - %d bytes missing!", + printf(" truncated-pppoe - %d bytes missing!", pppoe_len - length); pppoe_len = length; } |