androiddump: Provide fifo argument to g_warning()
When EXTCAP_ANDROIDDUMP_LIBPCAP=1, the compiler warns:
In file included from /usr/include/glib-2.0/glib.h:62:0,
from extcap-base.h:29,
from androiddump.c:26:
androiddump.c: In function ‘extcap_dumper_open’:
androiddump.c:366:19: warning: format ‘%s’ expects a matching ‘char *’
argument [-Wformat=]
g_warning("Can't open %s for saving packets: %s",
pcap_geterr(pcap));
(et cetera)
Fix three occurrences of that warning by using char *fifo as it was
apparently intended.
Fixes: 67a5d9bebe
Change-Id: I0597a345d87594cbe548d118a57e3751d0e3abf6
Reviewed-on: https://code.wireshark.org/review/35853
Reviewed-by: Dario Lombardo <lomato@gmail.com>
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
parent
380282d9cf
commit
fde8f715ed
|
@ -438,13 +438,13 @@ static struct extcap_dumper extcap_dumper_open(char *fifo, int encap) {
|
|||
pcap = pcap_open_dead_with_tstamp_precision(encap, PACKET_LENGTH, PCAP_TSTAMP_PRECISION_NANO);
|
||||
extcap_dumper.dumper.pcap = pcap_dump_open(pcap, fifo);
|
||||
if (!extcap_dumper.dumper.pcap) {
|
||||
g_warning("Can't open %s for saving packets: %s", pcap_geterr(pcap));
|
||||
g_warning("Can't open %s for saving packets: %s", fifo, pcap_geterr(pcap));
|
||||
pcap_close(pcap);
|
||||
exit(EXIT_CODE_CANNOT_SAVE_LIBPCAP_DUMP);
|
||||
}
|
||||
extcap_dumper.encap = encap;
|
||||
if (pcap_dump_flush(extcap_dumper.dumper.pcap) == -1) {
|
||||
g_warning("Write to %s failed: %s", g_strerror(errno));
|
||||
g_warning("Write to %s failed: %s", fifo, g_strerror(errno));
|
||||
}
|
||||
#else
|
||||
wtap_dump_params params = WTAP_DUMP_PARAMS_INIT;
|
||||
|
@ -480,7 +480,7 @@ static gboolean extcap_dumper_dump(struct extcap_dumper extcap_dumper,
|
|||
|
||||
pcap_dump((u_char *) extcap_dumper.dumper.pcap, &pcap_header, buffer);
|
||||
if (pcap_dump_flush(extcap_dumper.dumper.pcap) == -1) {
|
||||
g_warning("Write to %s failed: %s", g_strerror(errno));
|
||||
g_warning("Write to %s failed: %s", fifo, g_strerror(errno));
|
||||
}
|
||||
#else
|
||||
int err = 0;
|
||||
|
|
Loading…
Reference in New Issue