Fix GCC12 warning on sprintf()

This commit is contained in:
Trung Le 2022-07-29 23:34:30 +10:00
parent d292e46148
commit 7544ae1718
2 changed files with 2 additions and 2 deletions

View file

@ -766,7 +766,7 @@ void F_BunnyScroll (void)
::g->laststage = stage;
}
sprintf (name,"END%i",stage);
snprintf (name, strlen(name), "END%i",stage);
V_DrawPatch ((ORIGINAL_WIDTH-13*8)/2, (ORIGINAL_HEIGHT-8*8)/2,0, (patch_t*)W_CacheLumpName (name,PU_CACHE_SHARED));
}

View file

@ -327,7 +327,7 @@ void HU_Init(void)
j = HU_FONTSTART;
for (i=0;i<HU_FONTSIZE;i++)
{
sprintf(buffer, "STCFN%.3d", j++);
snprintf(buffer, strlen(buffer), "STCFN%.3d", j++);
::g->hu_font[i] = (patch_t *) W_CacheLumpName(buffer, PU_STATIC_SHARED);
}