From 13bf4a0c551be51f5c5303f69c1754577ea938a0 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Fri, 7 May 2010 08:40:02 +0000 Subject: 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 --- dumpcap.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'dumpcap.c') 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" @@ -382,6 +383,26 @@ show_version(GString *comp_info_str, GString *runtime_info_str) wireshark_svnversion, get_copyright_info() ,comp_info_str->str, runtime_info_str->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. */ -- cgit v1.2.3