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 --- tshark.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'tshark.c') diff --git a/tshark.c b/tshark.c index 33cbb103d1..3ed559c92d 100644 --- a/tshark.c +++ b/tshark.c @@ -77,6 +77,7 @@ #include #include "util.h" #include "clopts_common.h" +#include "console_io.h" #include "cmdarg_err.h" #include "version_info.h" #include @@ -3397,6 +3398,26 @@ write_failure_message(const char *filename, int err) filename, strerror(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. */ -- cgit v1.2.3