summaryrefslogtreecommitdiffstats
path: root/usr.sbin/tcpdump/print-bootp.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/print-bootp.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/print-bootp.c')
-rw-r--r--usr.sbin/tcpdump/print-bootp.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/usr.sbin/tcpdump/print-bootp.c b/usr.sbin/tcpdump/print-bootp.c
index 47d947a3d04..5c90f39f6e0 100644
--- a/usr.sbin/tcpdump/print-bootp.c
+++ b/usr.sbin/tcpdump/print-bootp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-bootp.c,v 1.23 2018/07/06 05:47:22 dlg Exp $ */
+/* $OpenBSD: print-bootp.c,v 1.24 2020/01/24 22:46:36 procter Exp $ */
/*
* Copyright (c) 1990, 1991, 1993, 1994, 1995, 1996, 1997
@@ -138,7 +138,7 @@ bootp_print(const u_char *cp, u_int length,
printf(" sname \"");
if (fn_print(bp->bp_sname, snapend)) {
putchar('"');
- fputs(tstr + 1, stdout);
+ printf("%s", tstr + 1);
return;
}
putchar('"');
@@ -148,7 +148,7 @@ bootp_print(const u_char *cp, u_int length,
printf(" file \"");
if (fn_print(bp->bp_file, snapend)) {
putchar('"');
- fputs(tstr + 1, stdout);
+ printf("%s", tstr + 1);
return;
}
putchar('"');
@@ -173,7 +173,7 @@ bootp_print(const u_char *cp, u_int length,
return;
trunc:
- fputs(tstr, stdout);
+ printf("%s", tstr);
}
/* The first character specifies the format to print */
@@ -289,12 +289,12 @@ rfc1048_print(const u_char *bp, u_int length)
/* Get the length; check for truncation */
if (bp + 1 >= snapend) {
- fputs(tstr, stdout);
+ printf("%s", tstr);
return;
}
len = *bp++;
if (bp + len >= snapend) {
- fputs(tstr, stdout);
+ printf("%s", tstr);
return;
}
@@ -465,6 +465,6 @@ cmu_print(const u_char *bp, u_int length)
return;
trunc:
- fputs(tstr, stdout);
+ printf("%s", tstr);
#undef PRINTCMUADDR
}