From 60bba061ba9bc8584d3036ae219cbc84423a7e01 Mon Sep 17 00:00:00 2001 From: naddy Date: Mon, 31 Jan 2022 19:08:29 +0000 Subject: [PATCH] tcpdump: fix -Wunused-but-set-variable warning All "infile" handling was moved into priv_exec() when tcpdump was privilege separated. The options are scanned both in priv_exec() and in main(), so the empty case needs to remain in the latter. ok deraadt@ --- usr.sbin/tcpdump/tcpdump.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/usr.sbin/tcpdump/tcpdump.c b/usr.sbin/tcpdump/tcpdump.c index e0b6a4b318a..e6e0e2cf45d 100644 --- a/usr.sbin/tcpdump/tcpdump.c +++ b/usr.sbin/tcpdump/tcpdump.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcpdump.c,v 1.95 2020/12/04 11:36:13 mvs Exp $ */ +/* $OpenBSD: tcpdump.c,v 1.96 2022/01/31 19:08:29 naddy Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997 @@ -208,7 +208,7 @@ main(int argc, char **argv) { int cnt = -1, op, i; bpf_u_int32 localnet, netmask; - char *cp, *infile = NULL, *RFileName = NULL; + char *cp, *RFileName = NULL; char ebuf[PCAP_ERRBUF_SIZE], *WFileName = NULL; pcap_handler printer; struct bpf_program *fcode; @@ -285,7 +285,6 @@ main(int argc, char **argv) break; case 'F': - infile = optarg; break; case 'i': -- 2.20.1