Fixed segmentation faults caused by NULL assignments to std::strings

This commit is contained in:
klapeto 2017-04-28 15:50:23 +03:00
parent 58b69b912a
commit b460d76698
2 changed files with 17 additions and 3 deletions

6
.gitignore vendored
View File

@ -62,3 +62,9 @@ xcuserdata/
*.ipa
*.dSYM.zip
*.dSYM
## Eclipse CDT generated files
/.autotools
/.cproject
/config.log
/.project

View File

@ -658,8 +658,16 @@ struct LastRom {
int NDS_LoadROM(const char *filename, const char *physicalName, const char *logicalFilename)
{
lastRom.filename = filename;
lastRom.physicalName = physicalName;
lastRom.logicalFilename = logicalFilename;
if (physicalName != NULL )
{
lastRom.physicalName = physicalName;
}
if (logicalFilename != NULL)
{
lastRom.logicalFilename = logicalFilename;
}
int ret;
char buf[MAX_PATH];
@ -3137,4 +3145,4 @@ void TCommonSettings::GameHacks::apply()
void TCommonSettings::GameHacks::clear()
{
memset(&flags,0,sizeof(flags));
}
}