reordercap: initialize command-line argument errors functions
authorPascal Quantin <pascal.quantin@gmail.com>
Mon, 11 Sep 2017 15:45:52 +0000 (17:45 +0200)
committerPascal Quantin <pascal.quantin@gmail.com>
Mon, 11 Sep 2017 19:53:49 +0000 (19:53 +0000)
Bug: 14055
Change-Id: I76959d97c45fb92473825b4a1ba708b0094d400a
Reviewed-on: https://code.wireshark.org/review/23499
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
reordercap.c

index ec7d4ce8efc6304cb2ce224a0111722e5761e80e..352c0c5a08e1edec951344220a78a95cf1d2d733 100644 (file)
@@ -38,6 +38,7 @@
 #include "wsutil/wsgetopt.h"
 #endif
 
+#include <wsutil/cmdarg_err.h>
 #include <wsutil/crash_info.h>
 #include <wsutil/filesystem.h>
 #include <wsutil/file_util.h>
@@ -147,7 +148,6 @@ frames_compare(gconstpointer a, gconstpointer b)
     return nstime_cmp(time1, time2);
 }
 
-#ifdef HAVE_PLUGINS
 /*
  * General errors and warnings are reported with an console message
  * in reordercap.
@@ -159,7 +159,16 @@ failure_warning_message(const char *msg_format, va_list ap)
     vfprintf(stderr, msg_format, ap);
     fprintf(stderr, "\n");
 }
-#endif
+
+/*
+ * Report additional information for an error in command-line arguments.
+ */
+static void
+failure_message_cont(const char *msg_format, va_list ap)
+{
+    vfprintf(stderr, msg_format, ap);
+    fprintf(stderr, "\n");
+}
 
 /********************************************************************/
 /* Main function.                                                   */
@@ -199,6 +208,8 @@ main(int argc, char *argv[])
     char *infile;
     const char *outfile;
 
+    cmdarg_err_init(failure_warning_message, failure_message_cont);
+
     /* Get the compile-time version information string */
     comp_info_str = get_compiled_version_info(NULL, NULL);