Fixed NULL check for SPostSave function pointer. Initialized SPreSave and SPostSave pointers to NULL to ensure their initial state is consistent. Also, init FCEU_state_loading_old_format to false as it is always better to have an initial state defined than none at all.

This commit is contained in:
mjbudd77 2020-12-30 15:20:34 -05:00
parent fde7bfab9f
commit 6724062581
1 changed files with 4 additions and 4 deletions

View File

@ -61,14 +61,14 @@
using namespace std;
static void (*SPreSave)(void);
static void (*SPostSave)(void);
static void (*SPreSave)(void) = NULL;
static void (*SPostSave)(void) = NULL;
static int SaveStateStatus[10];
static int StateShow;
//tells the save system innards that we're loading the old format
bool FCEU_state_loading_old_format;
bool FCEU_state_loading_old_format = false;
char lastSavestateMade[2048]; //Stores the filename of the last savestate made (needed for UndoSavestate)
bool undoSS = false; //This will be true if there is lastSavestateMade, it was made since ROM was loaded, a backup state for lastSavestateMade exists
@ -413,7 +413,7 @@ bool FCEUSS_SaveMS(EMUFILE* outstream, int compressionLevel)
if(SPreSave) SPreSave();
totalsize+=WriteStateChunk(os,0x10,SFMDATA);
if(SPreSave) SPostSave();
if(SPostSave) SPostSave();
//save the length of the file
int len = memory_savestate.size();