[RTPproxy] Remove non-existent reply
[metze/wireshark/wip.git] / editcap.c
index 3af02b54c41acaf11a688c5ae844732287de8500..9f08f0b3fb79d83098f577122895e4f560b6aedd 100644 (file)
--- a/editcap.c
+++ b/editcap.c
 #include <getopt.h>
 #endif
 
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-
 #ifdef HAVE_LIBZ
 #include <zlib.h>     /* to get the libz version number */
 #endif
 # include "wsutil/strptime.h"
 #endif
 
-#include <wsutil/privileges.h>
+#include <wsutil/crash_info.h>
 #include <wsutil/filesystem.h>
-#include <wsutil/report_err.h>
-#include <wsutil/strnatcmp.h>
 #include <wsutil/md5.h>
 #include <wsutil/plugins.h>
-#include <wsutil/crash_info.h>
+#include <wsutil/privileges.h>
+#include <wsutil/report_err.h>
+#include <wsutil/strnatcmp.h>
+#include <wsutil/ws_diag_control.h>
 #include <wsutil/ws_version_info.h>
 
-#include "version_info.h"
-
 #include "ringbuffer.h" /* For RINGBUFFER_MAX_NUM_FILES */
 
 /*
@@ -883,11 +878,13 @@ main(int argc, char *argv[])
     int           i, j, err;
     gchar        *err_info;
     int           opt;
+DIAG_OFF(cast-qual)
     static const struct option long_options[] = {
         {(char *)"help", no_argument, NULL, 'h'},
         {(char *)"version", no_argument, NULL, 'V'},
         {0, 0, 0, 0 }
     };
+DIAG_ON(cast-qual)
 
     char         *p;
     guint32       snaplen            = 0; /* No limit               */
@@ -924,13 +921,11 @@ main(int argc, char *argv[])
     create_app_running_mutex();
 #endif /* _WIN32 */
 
-    /* Assemble the compile-time version information string */
-    comp_info_str = g_string_new("Compiled ");
-    get_compiled_version_info(comp_info_str, NULL, get_editcap_compiled_info);
+    /* Get the compile-time version information string */
+    comp_info_str = get_compiled_version_info(NULL, get_editcap_compiled_info);
 
-    /* Assemble the run-time version information string */
-    runtime_info_str = g_string_new("Running ");
-    get_runtime_version_info(runtime_info_str, get_editcap_runtime_info);
+    /* Get the run-time version information string */
+    runtime_info_str = get_runtime_version_info(get_editcap_runtime_info);
 
     /* Add it to the information to be reported on a crash. */
     ws_add_crash_info("Editcap (Wireshark) %s\n"
@@ -948,7 +943,7 @@ main(int argc, char *argv[])
 
 #ifdef HAVE_PLUGINS
     /* Register wiretap plugins */
-    if ((init_progfile_dir_error = init_progfile_dir(argv[0], main))) {
+    if ((init_progfile_dir_error = init_progfile_dir(argv[0], (void *)main))) {
         g_warning("editcap: init_progfile_dir(): %s", init_progfile_dir_error);
         g_free(init_progfile_dir_error);
     } else {
@@ -1078,7 +1073,7 @@ main(int argc, char *argv[])
             break;
 
         case 'E':
-            err_prob = strtod(optarg, &p);
+            err_prob = g_ascii_strtod(optarg, &p);
             if (p == optarg || err_prob < 0.0 || err_prob > 1.0) {
                 fprintf(stderr, "editcap: probability \"%s\" must be between 0.0 and 1.0\n",
                         optarg);