diff options
author | tuexen <tuexen@f5534014-38df-0310-8fa8-9805f1628bb7> | 2011-05-28 12:48:21 +0000 |
---|---|---|
committer | tuexen <tuexen@f5534014-38df-0310-8fa8-9805f1628bb7> | 2011-05-28 12:48:21 +0000 |
commit | ab72e801c93b50918209302ff0334dd17d0c1119 (patch) | |
tree | 2b2424c2449a13454586e25c5563f1783d98760d /dumpcap.c | |
parent | 8d834c7a9b27bb360fe0a4b2cd8f54d9c7a59797 (diff) |
Initialize pcap using an empty array instead of NULL. So no special
check is needed.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@37445 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'dumpcap.c')
-rw-r--r-- | dumpcap.c | 13 |
1 files changed, 5 insertions, 8 deletions
@@ -3043,7 +3043,6 @@ capture_loop_start(capture_options *capture_opts, gboolean *stats_known, struct #ifdef SIGINFO global_ld.report_packet_count = FALSE; #endif - global_ld.pcaps = g_array_new(FALSE, FALSE, sizeof(pcap_options *)); if (capture_opts->has_autostop_packets) global_ld.packet_max = capture_opts->autostop_packets; else @@ -3482,12 +3481,10 @@ static void capture_loop_stop(void) guint i; pcap_options *pcap_opts; - if (global_ld.pcaps) { - for (i = 0; i < global_ld.pcaps->len; i++) { - pcap_opts = g_array_index(global_ld.pcaps, pcap_options *, i); - if (pcap_opts->pcap_h != NULL) - pcap_breakloop(pcap_opts->pcap_h); - } + for (i = 0; i < global_ld.pcaps->len; i++) { + pcap_opts = g_array_index(global_ld.pcaps, pcap_options *, i); + if (pcap_opts->pcap_h != NULL) + pcap_breakloop(pcap_opts->pcap_h); } #endif global_ld.go = FALSE; @@ -3818,7 +3815,7 @@ main(int argc, char *argv[]) console_log_handler, NULL /* user_data */); /* Initialize the pcaps list */ - global_ld.pcaps = NULL; + global_ld.pcaps = g_array_new(FALSE, FALSE, sizeof(pcap_options *)); /* Initialize the thread system */ if (!g_thread_supported()) |