diff options
author | Pascal Quantin <pascal.quantin@gmail.com> | 2017-09-11 17:45:52 +0200 |
---|---|---|
committer | Pascal Quantin <pascal.quantin@gmail.com> | 2017-09-11 20:58:56 +0000 |
commit | 9e1bfc05b04f0d0206cb15b16d93757b4465df01 (patch) | |
tree | e27320a57fc877b3423804429772cc856460062e /reordercap.c | |
parent | fadd4b995b26df79ed6aacd129147cc04a77ae77 (diff) | |
download | wireshark-9e1bfc05b04f0d0206cb15b16d93757b4465df01.tar.gz wireshark-9e1bfc05b04f0d0206cb15b16d93757b4465df01.tar.bz2 wireshark-9e1bfc05b04f0d0206cb15b16d93757b4465df01.zip |
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>
(cherry picked from commit d6dff9bc96c59be8ad81d1659c2da2f0e4d33c2d)
Reviewed-on: https://code.wireshark.org/review/23503
Diffstat (limited to 'reordercap.c')
-rw-r--r-- | reordercap.c | 15 |
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); |