aboutsummaryrefslogtreecommitdiffstats
path: root/dumpcap.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 /dumpcap.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 'dumpcap.c')
-rw-r--r--dumpcap.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/dumpcap.c b/dumpcap.c
index 944e5606e1..e6de0d1fac 100644
--- a/dumpcap.c
+++ b/dumpcap.c
@@ -72,6 +72,7 @@
#include "ringbuffer.h"
#include "clopts_common.h"
+#include "console_io.h"
#include "cmdarg_err.h"
#include "version_info.h"
@@ -383,6 +384,26 @@ show_version(GString *comp_info_str, GString *runtime_info_str)
}
/*
+ * 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