curbgname need one more byte to hold the NULL

This commit is contained in:
Alam Ed Arias 2019-08-08 23:44:28 -04:00
parent 92a954609d
commit fd77fe819b
3 changed files with 6 additions and 6 deletions

View file

@ -68,7 +68,7 @@ static INT32 menuanimtimer; // Title screen: background animation timing
mobj_t *titlemapcameraref = NULL;
// menu presentation state
char curbgname[8];
char curbgname[9];
SINT8 curfadevalue;
boolean curhidepics;
INT32 curbgcolor;
@ -2093,7 +2093,7 @@ void F_InitMenuPresValues(void)
activeMenuId = MainDef.menuid;
// Set defaults for presentation values
strncpy(curbgname, "TITLESKY", 8);
strncpy(curbgname, "TITLESKY", 9);
curfadevalue = 16;
curhidepics = hidetitlepics;
curbgcolor = -1;

View file

@ -87,7 +87,7 @@ typedef enum
// Current menu parameters
extern mobj_t *titlemapcameraref;
extern char curbgname[8];
extern char curbgname[9];
extern SINT8 curfadevalue;
extern boolean curhidepics;
extern INT32 curbgcolor;

View file

@ -2336,7 +2336,7 @@ static boolean MIT_SetCurBackground(UINT32 menutype, INT32 level, INT32 *retval,
}
else if (menupres[menutype].bgname[0])
{
strncpy(curbgname, menupres[menutype].bgname, 8);
strncpy(curbgname, menupres[menutype].bgname, 9);
curbgxspeed = menupres[menutype].titlescrollxspeed != INT32_MAX ? menupres[menutype].titlescrollxspeed : titlescrollxspeed;
curbgyspeed = menupres[menutype].titlescrollyspeed != INT32_MAX ? menupres[menutype].titlescrollyspeed : titlescrollyspeed;
return true;
@ -2349,7 +2349,7 @@ static boolean MIT_SetCurBackground(UINT32 menutype, INT32 level, INT32 *retval,
curbghide = true;
else
{
strncpy(curbgname, defaultname, 8);
strncpy(curbgname, defaultname, 9);
curbgxspeed = (gamestate == GS_TIMEATTACK) ? 0 : titlescrollxspeed;
curbgyspeed = (gamestate == GS_TIMEATTACK) ? 0 : titlescrollyspeed;
}
@ -2508,7 +2508,7 @@ static void M_HandleMenuPresState(menu_t *newMenu)
activeMenuId = newMenu ? newMenu->menuid : 0;
// Set defaults for presentation values
strncpy(curbgname, "TITLESKY", 8);
strncpy(curbgname, "TITLESKY", 9);
curfadevalue = 16;
curhidepics = hidetitlepics;
curbgcolor = -1;