Saves: Change header string to "E32SAVEGAME" (but still accept "EDuke32SAVE")

git-svn-id: https://svn.eduke32.com/eduke32@6739 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2018-03-08 03:54:58 +00:00
parent 4158aa802a
commit f4ba85b600

View file

@ -1334,7 +1334,7 @@ int32_t sv_saveandmakesnapshot(FILE *fil, char const *name, int8_t spot, int8_t
// create header // create header
Bmemcpy(h.headerstr, "EDuke32SAVE", 11); Bmemcpy(h.headerstr, "E32SAVEGAME", 11);
h.majorver = SV_MAJOR_VER; h.majorver = SV_MAJOR_VER;
h.minorver = SV_MINOR_VER; h.minorver = SV_MINOR_VER;
h.ptrsize = sizeof(intptr_t); h.ptrsize = sizeof(intptr_t);
@ -1450,11 +1450,17 @@ int32_t sv_loadheader(int32_t fil, int32_t spot, savehead_t *h)
return -1; return -1;
} }
if (Bmemcmp(h->headerstr, "EDuke32SAVE", 11)) if (Bmemcmp(h->headerstr, "E32SAVEGAME", 11)
#if 1
&& Bmemcmp(h->headerstr, "EDuke32SAVE", 11)
#endif
)
{ {
h->headerstr[sizeof(h->headerstr)-1] = 0; char headerCstr[sizeof(h->headerstr) + 1];
OSD_Printf("%s %d header reads \"%s\", expected \"EDuke32SAVE\".\n", Bmemcpy(headerCstr, h->headerstr, sizeof(h->headerstr));
havedemo ? "Demo":"Savegame", havedemo ? -spot : spot, h->headerstr); headerCstr[sizeof(h->headerstr)] = '\0';
OSD_Printf("%s %d header reads \"%s\", expected \"E32SAVEGAME\".\n",
havedemo ? "Demo":"Savegame", havedemo ? -spot : spot, headerCstr);
Bmemset(h->headerstr, 0, sizeof(h->headerstr)); Bmemset(h->headerstr, 0, sizeof(h->headerstr));
return -2; return -2;
} }