aboutsummaryrefslogtreecommitdiffstats
path: root/tshark.c
diff options
context:
space:
mode:
Diffstat (limited to 'tshark.c')
-rw-r--r--tshark.c32
1 files changed, 9 insertions, 23 deletions
diff --git a/tshark.c b/tshark.c
index 8d27037772..2be3e8b81b 100644
--- a/tshark.c
+++ b/tshark.c
@@ -64,6 +64,9 @@
#include <epan/exceptions.h>
#include <epan/epan-int.h>
#include <epan/epan.h>
+
+#include <wsutil/clopts_common.h>
+#include <wsutil/cmdarg_err.h>
#include <wsutil/crash_info.h>
#include <wsutil/privileges.h>
#include <wsutil/file_util.h>
@@ -88,8 +91,6 @@
#include <epan/addr_resolv.h>
#include "ui/util.h"
#include "ui/ui_util.h"
-#include "clopts_common.h"
-#include "cmdarg_err.h"
#include "version_info.h"
#include "register.h"
#include <epan/epan_dissect.h>
@@ -212,6 +213,7 @@ static void open_failure_message(const char *filename, int err,
static void failure_message(const char *msg_format, va_list ap);
static void read_failure_message(const char *filename, int err);
static void write_failure_message(const char *filename, int err);
+static void failure_message_cont(const char *msg_format, va_list ap);
capture_file cfile;
@@ -1009,6 +1011,8 @@ main(int argc, char *argv[])
}
#endif
+ cmdarg_err_init(failure_message, failure_message_cont);
+
/* Assemble the compile-time version information string */
comp_info_str = g_string_new("Compiled ");
get_compiled_version_info(comp_info_str, NULL, epan_get_compiled_version_info);
@@ -4315,33 +4319,15 @@ write_failure_message(const char *filename, int err)
}
/*
- * Report an error in command-line arguments.
- */
-void
-cmdarg_err(const char *fmt, ...)
-{
- va_list ap;
-
- va_start(ap, fmt);
- failure_message(fmt, ap);
- va_end(ap);
-}
-
-/*
* Report additional information for an error in command-line arguments.
*/
-void
-cmdarg_err_cont(const char *fmt, ...)
+static void
+failure_message_cont(const char *msg_format, va_list ap)
{
- va_list ap;
-
- va_start(ap, fmt);
- vfprintf(stderr, fmt, ap);
+ vfprintf(stderr, msg_format, ap);
fprintf(stderr, "\n");
- va_end(ap);
}
-
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*