Changed Qt symbolic debugger file save function to use std::string for filepath.

This commit is contained in:
harry 2023-01-16 09:50:38 -05:00
parent ba47f169ca
commit 50a7bb70c8
1 changed files with 7 additions and 7 deletions

View File

@ -116,6 +116,7 @@ int debugSymbolPage_t::save(void)
debugSymbol_t *sym;
std::map <int, debugSymbol_t*>::iterator it;
const char *romFile;
std::string filename;
char stmp[512];
int i,j;
@ -142,19 +143,18 @@ int debugSymbolPage_t::save(void)
if ( romFile[i] == '|' )
{
stmp[i] = '.';
filename.push_back('.');
}
else
{
stmp[i] = romFile[i];
filename.push_back(romFile[i]);
}
i++;
}
stmp[i] = 0;
if ( pageNum < 0 )
{
strcat( stmp, ".ram.nl" );
filename.append(".ram.nl" );
}
else
{
@ -162,14 +162,14 @@ int debugSymbolPage_t::save(void)
sprintf( suffix, ".%X.nl", pageNum );
strcat( stmp, suffix );
filename.append( suffix );
}
fp = fopen( stmp, "w" );
fp = ::fopen( filename.c_str(), "w" );
if ( fp == NULL )
{
printf("Error: Could not open file '%s' for writing\n", stmp );
printf("Error: Could not open file '%s' for writing\n", filename.c_str() );
return -1;
}