Fix stringop-truncation: ‘strncpy’ output truncated before terminating nul copying 8 bytes from a string of the same length

This commit is contained in:
Alam Ed Arias 2018-11-14 16:32:57 -05:00
parent 4e9fc881a2
commit fb08950c19

View file

@ -2323,7 +2323,7 @@ static void Sk_SetDefaultValue(skin_t *skin)
strcpy(skin->realname, "Someone");
strcpy(skin->hudname, "???");
strncpy(skin->charsel, "CHRSONIC", 8);
strncpy(skin->charsel, "CHRSONIC", 9);
strncpy(skin->face, "MISSING", 8);
strncpy(skin->superface, "MISSING", 8);
@ -2384,9 +2384,9 @@ void R_InitSkins(void)
strcpy(skin->realname, "Sonic");
strcpy(skin->hudname, "SONIC");
strncpy(skin->charsel, "CHRSONIC", 8);
strncpy(skin->face, "LIVSONIC", 8);
strncpy(skin->superface, "LIVSUPER", 8);
strncpy(skin->charsel, "CHRSONIC", 9);
strncpy(skin->face, "LIVSONIC", 9);
strncpy(skin->superface, "LIVSUPER", 9);
skin->prefcolor = SKINCOLOR_BLUE;
skin->ability = CA_THOK;