summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2016-06-26 18:02:12 -0700
committerGuy Harris <guy@alum.mit.edu>2016-06-26 18:02:12 -0700
commit0e34f5d742dbced0374217501ed9db1a79034b35 (patch)
treec751fc032c74ec21461d0b84b0675c7b5578da1b
parent066ee5ae71c8b9794436f4e203160c16d680e99b (diff)
downloadtcpdump-0e34f5d742dbced0374217501ed9db1a79034b35.tar.gz
Squelch a compiler warning.
It may not be necessary, but it makes the code a bit cleaner, even if you spend a few extra microseconds per file fetching the name of the link-layer header type even if the new file has the same header type.
-rw-r--r--tcpdump.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tcpdump.c b/tcpdump.c
index 3d491c4e..1db35daa 100644
--- a/tcpdump.c
+++ b/tcpdump.c
@@ -1849,7 +1849,6 @@ main(int argc, char **argv)
*/
dlt = new_dlt;
ndo->ndo_if_printer = get_if_printer(ndo, dlt);
- dlt_name = pcap_datalink_val_to_name(dlt);
if (pcap_compile(pd, &fcode, cmdbuf, Oflag, netmask) < 0)
error("%s", pcap_geterr(pd));
}
@@ -1863,6 +1862,7 @@ main(int argc, char **argv)
/*
* Report the new file.
*/
+ dlt_name = pcap_datalink_val_to_name(dlt);
if (dlt_name == NULL) {
fprintf(stderr, "reading from file %s, link-type %u\n",
RFileName, dlt);