aboutsummaryrefslogtreecommitdiffstats
path: root/reordercap.c
diff options
context:
space:
mode:
authorPascal Quantin <pascal.quantin@gmail.com>2017-09-11 17:45:52 +0200
committerPascal Quantin <pascal.quantin@gmail.com>2017-09-11 19:53:49 +0000
commitd6dff9bc96c59be8ad81d1659c2da2f0e4d33c2d (patch)
treedeb7ad2e78eb57fc3a9ce1b578ffcc0c2b142972 /reordercap.c
parent83aabe5500fda8fda8a5eb09982361f0df860e6f (diff)
reordercap: initialize command-line argument errors functions
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>
Diffstat (limited to 'reordercap.c')
-rw-r--r--reordercap.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/reordercap.c b/reordercap.c
index ec7d4ce8ef..352c0c5a08 100644
--- a/reordercap.c
+++ b/reordercap.c
@@ -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);