aboutsummaryrefslogtreecommitdiffstats
path: root/dumpcap.c
diff options
context:
space:
mode:
authortuexen <tuexen@f5534014-38df-0310-8fa8-9805f1628bb7>2011-05-28 12:48:21 +0000
committertuexen <tuexen@f5534014-38df-0310-8fa8-9805f1628bb7>2011-05-28 12:48:21 +0000
commitab72e801c93b50918209302ff0334dd17d0c1119 (patch)
tree2b2424c2449a13454586e25c5563f1783d98760d /dumpcap.c
parent8d834c7a9b27bb360fe0a4b2cd8f54d9c7a59797 (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.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/dumpcap.c b/dumpcap.c
index 1ca5a3654f..c1176574db 100644
--- a/dumpcap.c
+++ b/dumpcap.c
@@ -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())