Don't create an array of size 0.

This commit is contained in:
Stephen Anthony 2020-05-09 15:13:08 -02:30
parent 2770845f6b
commit 2ae04d7450
1 changed files with 4 additions and 2 deletions

View File

@ -52,7 +52,8 @@ void CartridgeEnhanced::install(System& system)
myCurrentSegOffset = make_unique<uInt32[]>(myBankSegs);
// Allocate array for the RAM area
myRAM = make_unique<uInt8[]>(myRamSize);
if(myRamSize > 0)
myRAM = make_unique<uInt8[]>(myRamSize);
mySystem = &system;
@ -101,7 +102,8 @@ void CartridgeEnhanced::install(System& system)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeEnhanced::reset()
{
initializeRAM(myRAM.get(), myRamSize);
if(myRamSize > 0)
initializeRAM(myRAM.get(), myRamSize);
initializeStartBank(getStartBank());