summaryrefslogtreecommitdiffstats
path: root/usr.sbin/tcpdump/print-ospf.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-ospf.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-ospf.c')
-rw-r--r--usr.sbin/tcpdump/print-ospf.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.sbin/tcpdump/print-ospf.c b/usr.sbin/tcpdump/print-ospf.c
index 28b0716aeba..43068928a56 100644
--- a/usr.sbin/tcpdump/print-ospf.c
+++ b/usr.sbin/tcpdump/print-ospf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-ospf.c,v 1.21 2019/04/14 00:37:31 dlg Exp $ */
+/* $OpenBSD: print-ospf.c,v 1.22 2020/01/24 22:46:37 procter Exp $ */
/*
* Copyright (c) 1992, 1993, 1994, 1995, 1996, 1997
@@ -348,10 +348,10 @@ ospf_print_lsa(const struct lsa *lsap)
}
/* { (ctags) */
- fputs(" }", stdout);
+ printf(" }");
return (0);
trunc:
- fputs(" }", stdout);
+ printf(" }");
return (1);
}
@@ -501,7 +501,7 @@ ospf_print(const u_char *bp, u_int length, const u_char *bp2)
op = (struct ospfhdr *)bp;
ip = (struct ip *)bp2;
/* Print the source and destination address */
- (void) printf("%s > %s:",
+ printf("%s > %s:",
ipaddr_string(&ip->ip_src),
ipaddr_string(&ip->ip_dst));
@@ -591,5 +591,5 @@ ospf_print(const u_char *bp, u_int length, const u_char *bp2)
return;
trunc:
- fputs(tstr, stdout);
+ printf("%s", tstr);
}