(Try to) fix VS Clang Analysis warning:
[metze/wireshark/wip.git] / capture_opts.c
index 9ec0b993f9a5091a24672038ea13abd3ad40ec7d..4ab473a5700db2d2da7e1a6302089335f16ce313 100644 (file)
@@ -25,6 +25,7 @@
 #include "config.h"
 
 #include <stdio.h>
+#include <stdlib.h>
 
 #ifdef HAVE_LIBPCAP
 
@@ -64,7 +65,7 @@ capture_opts_init(capture_options *capture_opts)
   capture_opts->default_options.cfilter         = NULL;
   capture_opts->default_options.has_snaplen     = FALSE;
   capture_opts->default_options.snaplen         = WTAP_MAX_PACKET_SIZE;
-  capture_opts->default_options.linktype        = -1;
+  capture_opts->default_options.linktype        = -1; /* use interface default */
   capture_opts->default_options.promisc_mode    = TRUE;
 #if defined(_WIN32) || defined(HAVE_PCAP_CREATE)
   capture_opts->default_options.buffer_size     = DEFAULT_CAPTURE_BUFFER_SIZE;
@@ -97,6 +98,7 @@ capture_opts_init(capture_options *capture_opts)
   capture_opts->show_info                       = TRUE;
   capture_opts->quit_after_cap                  = getenv("WIRESHARK_QUIT_AFTER_CAPTURE") ? TRUE : FALSE;
   capture_opts->restart                         = FALSE;
+  capture_opts->orig_save_file                  = NULL;
 
   capture_opts->multi_files_on                  = FALSE;
   capture_opts->has_file_duration               = FALSE;
@@ -109,7 +111,7 @@ capture_opts_init(capture_options *capture_opts)
   capture_opts->has_autostop_packets            = FALSE;
   capture_opts->autostop_packets                = 0;
   capture_opts->has_autostop_filesize           = FALSE;
-  capture_opts->autostop_filesize               = 1024;             /* 1 MB */
+  capture_opts->autostop_filesize               = 1000;             /* 1 MB */
   capture_opts->has_autostop_duration           = FALSE;
   capture_opts->autostop_duration               = 60;               /* 1 min */
   capture_opts->capture_comment                 = NULL;