From 6d2ffb4c637a49983bc6ce22b68ccec0ed09e0f4 Mon Sep 17 00:00:00 2001 From: Tim Angus Date: Sat, 3 Oct 2009 15:17:16 +0000 Subject: * Merge ioq3-r1637 --- src/tools/asm/cmdlib.c | 8 +++++--- src/tools/asm/q3asm.c | 17 +++++++++-------- 2 files changed, 14 insertions(+), 11 deletions(-) (limited to 'src/tools') diff --git a/src/tools/asm/cmdlib.c b/src/tools/asm/cmdlib.c index ac088675..aca34313 100644 --- a/src/tools/asm/cmdlib.c +++ b/src/tools/asm/cmdlib.c @@ -186,7 +186,7 @@ void _printf( const char *format, ... ) { vsprintf (text, format, argptr); va_end (argptr); - printf(text); + printf("%s", text); #ifdef WIN32 if (!lookedForServer) { @@ -397,10 +397,12 @@ void Q_getwd (char *out) int i = 0; #ifdef WIN32 - _getcwd (out, 256); + if (_getcwd (out, 256) == NULL) + strcpy(out, "."); /* shrug */ strcat (out, "\\"); #else - getcwd (out, 256); + if (getcwd (out, 256) == NULL) + strcpy(out, "."); /* shrug */ strcat (out, "/"); #endif diff --git a/src/tools/asm/q3asm.c b/src/tools/asm/q3asm.c index 3c334815..481a1acb 100644 --- a/src/tools/asm/q3asm.c +++ b/src/tools/asm/q3asm.c @@ -490,10 +490,10 @@ static void CodeError( char *fmt, ... ) { errorCount++; - report( "%s:%i ", currentFileName, currentFileLine ); + fprintf( stderr, "%s:%i ", currentFileName, currentFileLine ); va_start( argptr,fmt ); - vprintf( fmt,argptr ); + vfprintf( stderr, fmt, argptr ); va_end( argptr ); } @@ -1521,12 +1521,13 @@ static void ShowHelp( char *argv0 ) { Error("Usage: %s [OPTION]... [FILES]...\n\ Assemble LCC bytecode assembly to Q3VM bytecode.\n\ \n\ - -o OUTPUT Write assembled output to file OUTPUT.qvm\n\ - -f LISTFILE Read options and list of files to assemble from LISTFILE.q3asm\n\ - -b BUCKETS Set symbol hash table to BUCKETS buckets\n\ - -v Verbose compilation report\n\ - -vq3 Produce a qvm file compatible with Q3 1.32b\n\ - -h --help -? Show this help\n\ + -o OUTPUT Write assembled output to file OUTPUT.qvm\n\ + -f LISTFILE Read options and list of files to assemble from LISTFILE.q3asm\n\ + -b BUCKETS Set symbol hash table to BUCKETS buckets\n\ + -m Generate a mapfile for each OUTPUT.qvm\n\ + -v Verbose compilation report\n\ + -vq3 Produce a qvm file compatible with Q3 1.32b\n\ + -h --help -? Show this help\n\ ", argv0); } -- cgit