Initialize pcap using an empty array instead of NULL. So no special
check is needed. svn path=/trunk/; revision=37445
This commit is contained in:
parent
521b65f257
commit
31c756a6d1
13
dumpcap.c
13
dumpcap.c
@ -3043,7 +3043,6 @@ capture_loop_start(capture_options *capture_opts, gboolean *stats_known, struct
|
|||||||
#ifdef SIGINFO
|
#ifdef SIGINFO
|
||||||
global_ld.report_packet_count = FALSE;
|
global_ld.report_packet_count = FALSE;
|
||||||
#endif
|
#endif
|
||||||
global_ld.pcaps = g_array_new(FALSE, FALSE, sizeof(pcap_options *));
|
|
||||||
if (capture_opts->has_autostop_packets)
|
if (capture_opts->has_autostop_packets)
|
||||||
global_ld.packet_max = capture_opts->autostop_packets;
|
global_ld.packet_max = capture_opts->autostop_packets;
|
||||||
else
|
else
|
||||||
@ -3482,12 +3481,10 @@ static void capture_loop_stop(void)
|
|||||||
guint i;
|
guint i;
|
||||||
pcap_options *pcap_opts;
|
pcap_options *pcap_opts;
|
||||||
|
|
||||||
if (global_ld.pcaps) {
|
for (i = 0; i < global_ld.pcaps->len; i++) {
|
||||||
for (i = 0; i < global_ld.pcaps->len; i++) {
|
pcap_opts = g_array_index(global_ld.pcaps, pcap_options *, i);
|
||||||
pcap_opts = g_array_index(global_ld.pcaps, pcap_options *, i);
|
if (pcap_opts->pcap_h != NULL)
|
||||||
if (pcap_opts->pcap_h != NULL)
|
pcap_breakloop(pcap_opts->pcap_h);
|
||||||
pcap_breakloop(pcap_opts->pcap_h);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
global_ld.go = FALSE;
|
global_ld.go = FALSE;
|
||||||
@ -3818,7 +3815,7 @@ main(int argc, char *argv[])
|
|||||||
console_log_handler, NULL /* user_data */);
|
console_log_handler, NULL /* user_data */);
|
||||||
|
|
||||||
/* Initialize the pcaps list */
|
/* Initialize the pcaps list */
|
||||||
global_ld.pcaps = NULL;
|
global_ld.pcaps = g_array_new(FALSE, FALSE, sizeof(pcap_options *));
|
||||||
|
|
||||||
/* Initialize the thread system */
|
/* Initialize the thread system */
|
||||||
if (!g_thread_supported())
|
if (!g_thread_supported())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user