From bd049528785aed47c42564d7e09cd6f75d480f07 Mon Sep 17 00:00:00 2001 From: Sjoerd van der Berg Date: Tue, 6 May 2003 07:35:44 +0000 Subject: [PATCH] Updated GFX_ShowMsg to use variable arguments Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@994 --- src/gui/sdlmain.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/gui/sdlmain.cpp b/src/gui/sdlmain.cpp index 4928e394..5dfd1dde 100644 --- a/src/gui/sdlmain.cpp +++ b/src/gui/sdlmain.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include "SDL.h" #include "SDL_thread.h" @@ -532,10 +533,12 @@ void GFX_Events() { } } -void GFX_ShowMsg(char * msg) { - char buf[1024]; - strcpy(buf,msg); - strcat(buf,"\n"); +void GFX_ShowMsg(char * format,...) { + char buf[512]; + va_list msg; + va_start(msg,format); + vsprintf(buf,format,msg); + va_end(msg); printf(buf); }; @@ -550,7 +553,7 @@ int main(int argc, char* argv[]) { DEBUG_SetupConsole(); #endif - if ( SDL_Init(SDL_INIT_AUDIO|SDL_INIT_VIDEO|SDL_INIT_TIMER|SDL_INIT_CDROM + if ( SDL_Init( SDL_INIT_AUDIO|SDL_INIT_VIDEO|SDL_INIT_TIMER|SDL_INIT_CDROM #ifndef DISABLE_JOYSTICK |SDL_INIT_JOYSTICK