From 7544ae17188f166e6e0d2dc6b11ca9d84afd6078 Mon Sep 17 00:00:00 2001 From: Trung Le Date: Fri, 29 Jul 2022 23:34:30 +1000 Subject: [PATCH] Fix GCC12 warning on sprintf() --- doomclassic/doom/f_finale.cpp | 2 +- doomclassic/doom/hu_stuff.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doomclassic/doom/f_finale.cpp b/doomclassic/doom/f_finale.cpp index 79dafc9a..65df7447 100644 --- a/doomclassic/doom/f_finale.cpp +++ b/doomclassic/doom/f_finale.cpp @@ -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)); } diff --git a/doomclassic/doom/hu_stuff.cpp b/doomclassic/doom/hu_stuff.cpp index b379ef54..73b0ada8 100644 --- a/doomclassic/doom/hu_stuff.cpp +++ b/doomclassic/doom/hu_stuff.cpp @@ -327,7 +327,7 @@ void HU_Init(void) j = HU_FONTSTART; for (i=0;ihu_font[i] = (patch_t *) W_CacheLumpName(buffer, PU_STATIC_SHARED); }