Fix bug #519
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4296
This commit is contained in:
parent
f1608a2509
commit
1521b7ad7d
3 changed files with 17 additions and 9 deletions
|
@ -1716,12 +1716,14 @@ static BOOL WINAPI ConsoleEventHandler(DWORD event) {
|
|||
static bool no_stdout = false;
|
||||
void GFX_ShowMsg(char const* format,...) {
|
||||
char buf[512];
|
||||
|
||||
va_list msg;
|
||||
va_start(msg,format);
|
||||
vsprintf(buf,format,msg);
|
||||
strcat(buf,"\n");
|
||||
vsnprintf(buf,sizeof(buf),format,msg);
|
||||
va_end(msg);
|
||||
if(!no_stdout) printf("%s",buf); //Else buf is parsed again.
|
||||
|
||||
buf[sizeof(buf) - 1] = '\0';
|
||||
if (!no_stdout) puts(buf); //Else buf is parsed again. (puts adds end of line)
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue