From b05c1e111168e3f07ac891335a68029d0abb7e60 Mon Sep 17 00:00:00 2001 From: cuz Date: Thu, 8 Jun 2000 18:18:40 +0000 Subject: [PATCH] Use xsprintf in common library git-svn-id: svn://svn.cc65.org/cc65/trunk@32 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- src/ld65/scanner.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/ld65/scanner.c b/src/ld65/scanner.c index 69db9f23f..4938159b3 100644 --- a/src/ld65/scanner.c +++ b/src/ld65/scanner.c @@ -39,6 +39,8 @@ #include #include +#include "../common/xsprintf.h" + #include "global.h" #include "error.h" #include "scanner.h" @@ -65,7 +67,7 @@ static const char* CfgName = 0; static const char* CfgBuf = 0; /* Other input stuff */ -static int C = ' '; +static int C = ' '; static unsigned InputLine = 1; static unsigned InputCol = 0; static FILE* InputFile = 0; @@ -73,7 +75,7 @@ static FILE* InputFile = 0; /*****************************************************************************/ -/* Error handling */ +/* Error handling */ /*****************************************************************************/ @@ -82,13 +84,12 @@ void CfgWarning (const char* Format, ...) /* Print a warning message adding file name and line number of the config file */ { char Buf [512]; - va_list ap; + va_list ap; + va_start (ap, Format); -#ifdef __WATCOMC__ - _vbprintf (Buf, sizeof (Buf), Format, ap); -#else - vsnprintf (Buf, sizeof (Buf), Format, ap); -#endif + xvsprintf (Buf, sizeof (Buf), Format, ap); + va_end (ap); + Warning ("%s(%u): %s", CfgName, CfgErrorLine, Buf); } @@ -99,12 +100,11 @@ void CfgError (const char* Format, ...) { char Buf [512]; va_list ap; + va_start (ap, Format); -#ifdef __WATCOMC__ - _vbprintf (Buf, sizeof (Buf), Format, ap); -#else - vsnprintf (Buf, sizeof (Buf), Format, ap); -#endif + xvsprintf (Buf, sizeof (Buf), Format, ap); + va_end (ap); + Error ("%s(%u): %s", CfgName, CfgErrorLine, Buf); }