From 4a363aa33c2fd9e756ac84e1a526f431ef670730 Mon Sep 17 00:00:00 2001 From: ccremers Date: Fri, 30 Dec 2005 12:03:19 +0000 Subject: [PATCH] - Bugfix: the single attack output adaptions from revision 1447 had broken some of the xml output. --- src/symbol.c | 22 ++++++++++++++++++---- src/symbol.h | 3 +++ src/xmlout.c | 2 +- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/src/symbol.c b/src/symbol.c index 17f30df..c12cbdb 100644 --- a/src/symbol.c +++ b/src/symbol.c @@ -309,6 +309,16 @@ symbol_fix_keylevels (void) } } +//! Get output stream pointer +FILE * +getOutputStream (void) +{ + if (globalError == 0) + return (FILE *) globalStream; + else + return stderr; +} + //! Print out according to globalError /** * Input is comparable to printf, only depends on globalError. This should be @@ -326,9 +336,13 @@ eprintf (char *fmt, ...) va_list args; va_start (args, fmt); - if (globalError == 0) - vfprintf ((FILE *) globalStream, fmt, args); - else - vfprintf (stderr, fmt, args); + vfprintf (getOutputStream (), fmt, args); va_end (args); } + +// Variable list variant +void +veprintf (const char *fmt, va_list args) +{ + vfprintf (getOutputStream (), fmt, args); +} diff --git a/src/symbol.h b/src/symbol.h index 949765a..1503cc8 100644 --- a/src/symbol.h +++ b/src/symbol.h @@ -1,6 +1,8 @@ #ifndef SYMBOLS #define SYMBOLS +#include + //! Size of symbol hashtable. /** Optimistically large. Should be a prime, says theory. */ @@ -47,6 +49,7 @@ void symbol_fix_keylevels (void); Symbol symbolNextFree (Symbol prefixsymbol); void eprintf (char *fmt, ...); +void veprintf (const char *fmt, va_list args); extern int globalError; extern char *globalStream; diff --git a/src/xmlout.c b/src/xmlout.c index dcf4e4f..721cd85 100644 --- a/src/xmlout.c +++ b/src/xmlout.c @@ -86,7 +86,7 @@ xmlPrint (char *fmt, ...) xmlIndentPrint (); va_start (args, fmt); - eprintf (fmt, args); + veprintf (fmt, args); va_end (args); eprintf ("\n"); }