diff --git a/desmume/src/NDSSystem.cpp b/desmume/src/NDSSystem.cpp index 9ef4ae8eb..ae8ad9275 100644 --- a/desmume/src/NDSSystem.cpp +++ b/desmume/src/NDSSystem.cpp @@ -315,12 +315,14 @@ void GameInfo::populate() strcat(ROMserial, regions[region]); else strcat(ROMserial, "Unknown"); + memset(ROMname, 0, sizeof(ROMname)); memcpy(ROMname, header.gameTile, 12); trim(ROMname); u8 num = (T1ReadByte((u8*)romdata, header.IconOff) == 1)?6:7; for (int i = 0; i < num; i++) { + memset(ROMfullName[i],0,sizeof(ROMfullName[i])); wcstombs(ROMfullName[i], (wchar_t *)(romdata+header.IconOff+0x240+(i*0x100)), 0x100); trim(ROMfullName[i]); } @@ -2018,7 +2020,7 @@ void NDS_Reset() if (firmware) { - delete [] firmware; + delete firmware; firmware = NULL; } firmware = new CFIRMWARE();