From: Francois-Xavier Le Bail Date: Thu, 8 Jul 2021 09:55:21 +0000 (+0200) Subject: Factorize some code X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/3f7d71ef1e4ed84e4aba0b125c1aebb37f611884 Factorize some code --- diff --git a/tcpdump.c b/tcpdump.c index 61317956..b7b6f995 100644 --- a/tcpdump.c +++ b/tcpdump.c @@ -456,13 +456,15 @@ show_dlts_and_exit(pcap_t *pc, const char *device) * monitor mode might be different from the ones available when * not in monitor mode). */ + (void) fprintf(stdout, "Data link types for "); if (supports_monitor_mode) - (void) fprintf(stdout, "Data link types for %s %s (use option -y to set):\n", + (void) fprintf(stdout, "%s %s", device, Iflag ? "when in monitor mode" : "when not in monitor mode"); else - (void) fprintf(stdout, "Data link types for %s (use option -y to set):\n", + (void) fprintf(stdout, "%s", device); + (void) fprintf(stdout, " (use option -y to set):\n"); for (i = 0; i < n_dlts; i++) { dlt_name = pcap_datalink_val_to_name(dlts[i]);