diff options
| author | 2020-01-24 22:46:36 +0000 | |
|---|---|---|
| committer | 2020-01-24 22:46:36 +0000 | |
| commit | f96bb33f4775ce2a1279cb96ebaecb010eb3bdc3 (patch) | |
| tree | 9b2ab0af0e72e725c026e33cb8dd0226e3808486 /usr.sbin/tcpdump/print-domain.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-domain.c')
| -rw-r--r-- | usr.sbin/tcpdump/print-domain.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/usr.sbin/tcpdump/print-domain.c b/usr.sbin/tcpdump/print-domain.c index 58f1e1c98c8..f5d74e8227c 100644 --- a/usr.sbin/tcpdump/print-domain.c +++ b/usr.sbin/tcpdump/print-domain.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-domain.c,v 1.26 2018/10/22 16:12:45 kn Exp $ */ +/* $OpenBSD: print-domain.c,v 1.27 2020/01/24 22:46:36 procter Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997 @@ -353,7 +353,7 @@ ns_qprint(const u_char *cp, const u_char *bp, int is_mdns) if (is_mdns && (i & C_QU)) printf(" (QU)"); - fputs("? ", stdout); + printf("? "); cp = ns_nprint(np, bp); return(cp ? cp + 4 : NULL); } @@ -604,7 +604,7 @@ ns_print(const u_char *bp, u_int length, int is_mdns) if (qdcount < EXTRACT_16BITS(&np->qdcount) - 1) putchar(','); if (vflag > 1) { - fputs(" q:", stdout); + printf(" q:"); if ((cp = ns_qprint(cp, bp, is_mdns)) == NULL) goto trunc; } else { @@ -628,7 +628,7 @@ ns_print(const u_char *bp, u_int length, int is_mdns) /* Print NS and AR sections on -vv */ if (vflag > 1) { if (cp < snapend && nscount--) { - fputs(" ns:", stdout); + printf(" ns:"); if ((cp = ns_rprint(cp, bp, is_mdns)) == NULL) goto trunc; while (cp < snapend && nscount--) { @@ -640,7 +640,7 @@ ns_print(const u_char *bp, u_int length, int is_mdns) if (nscount > 0) goto trunc; if (cp < snapend && arcount--) { - fputs(" ar:", stdout); + printf(" ar:"); if ((cp = ns_rprint(cp, bp, is_mdns)) == NULL) goto trunc; while (cp < snapend && arcount--) { @@ -712,7 +712,7 @@ ns_print(const u_char *bp, u_int length, int is_mdns) if (ancount > 0) goto trunc; if (cp < snapend && nscount--) { - fputs(" ns:", stdout); + printf(" ns:"); if ((cp = ns_rprint(cp, bp, is_mdns)) == NULL) goto trunc; while (nscount-- && cp < snapend) { @@ -724,7 +724,7 @@ ns_print(const u_char *bp, u_int length, int is_mdns) if (nscount > 0) goto trunc; if (cp < snapend && arcount--) { - fputs(" ar:", stdout); + printf(" ar:"); if ((cp = ns_rprint(cp, bp, is_mdns)) == NULL) goto trunc; while (cp < snapend && arcount--) { |
