aboutsummaryrefslogtreecommitdiffstats
path: root/tshark.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2010-05-07 08:40:02 +0000
committerGuy Harris <guy@alum.mit.edu>2010-05-07 08:40:02 +0000
commit13bf4a0c551be51f5c5303f69c1754577ea938a0 (patch)
tree8d6e002c3ba1b61b00021232f4dea1037808f024 /tshark.c
parentcc05b9250d271bf75d814d6880b11a4fc4a0540a (diff)
Add routines vfprintf_stderr() and fprintf_stderr() to print to the
standard error and, in Wireshark on Windows, create a console if necessary. Have the cmdarg_err routines use them. Use *fprintf_stderr() to print the output of -L, rather than using cmdarg_err_cont(), so that we don't get extra newlines in the output (it should look similar to the output of tcpdump). svn path=/trunk/; revision=32711
Diffstat (limited to 'tshark.c')
-rw-r--r--tshark.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/tshark.c b/tshark.c
index 33cbb103d1..3ed559c92d 100644
--- a/tshark.c
+++ b/tshark.c
@@ -77,6 +77,7 @@
#include <epan/addr_resolv.h>
#include "util.h"
#include "clopts_common.h"
+#include "console_io.h"
#include "cmdarg_err.h"
#include "version_info.h"
#include <epan/plugins.h>
@@ -3398,6 +3399,26 @@ write_failure_message(const char *filename, int err)
}
/*
+ * Print to the standard error. This is a command-line tool, so there's
+ * no need to pop up a console.
+ */
+void
+vfprintf_stderr(const char *fmt, va_list ap)
+{
+ vfprintf(stderr, fmt, ap);
+}
+
+void
+fprintf_stderr(const char *fmt, ...)
+{
+ va_list ap;
+
+ va_start(ap, fmt);
+ vfprintf_stderr(fmt, ap);
+ va_end(ap);
+}
+
+/*
* Report an error in command-line arguments.
*/
void