Bug fix for Qt GUI message log in windows.

This commit is contained in:
mjbudd77 2021-02-11 18:09:48 -05:00
parent 97c8c591bd
commit 1a622b5f30
1 changed files with 17 additions and 1 deletions

View File

@ -24,6 +24,10 @@
#include <string.h>
#include <string>
#ifdef WIN32
#include <Windows.h>
#endif
#include <SDL.h>
#include <QHeaderView>
#include <QCloseEvent>
@ -44,9 +48,21 @@ class msgLogBuf_t
public:
msgLogBuf_t(void)
{
char filename[256];
char filename[512];
#ifdef WIN32
if ( GetTempPathA( sizeof(filename), filename ) > 0 )
{
//printf("PATH: %s \n", filename );
strcat( filename, "fceux.log");
}
else
{
strcpy( filename, "fceux.log" );
}
#else
strcpy( filename, "/tmp/fceux.log" );
#endif
fp = ::fopen( filename, "w+");