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 *.ipa
*.dSYM.zip *.dSYM.zip
*.dSYM *.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) int NDS_LoadROM(const char *filename, const char *physicalName, const char *logicalFilename)
{ {
lastRom.filename = filename; lastRom.filename = filename;
if (physicalName != NULL )
{
lastRom.physicalName = physicalName; lastRom.physicalName = physicalName;
}
if (logicalFilename != NULL)
{
lastRom.logicalFilename = logicalFilename; lastRom.logicalFilename = logicalFilename;
}
int ret; int ret;
char buf[MAX_PATH]; char buf[MAX_PATH];