From f67a6733d931c3bdb1770190cc117c1a6b26867b Mon Sep 17 00:00:00 2001 From: Robert Beckebans Date: Mon, 5 Sep 2022 22:18:39 +0200 Subject: [PATCH] Fixed GCC compile errors in doomclassic code --- doomclassic/doom/f_finale.cpp | 5 +++-- doomclassic/doom/hu_stuff.cpp | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/doomclassic/doom/f_finale.cpp b/doomclassic/doom/f_finale.cpp index 65df7447..3fc05569 100644 --- a/doomclassic/doom/f_finale.cpp +++ b/doomclassic/doom/f_finale.cpp @@ -725,7 +725,8 @@ void F_BunnyScroll (void) int x; patch_t* p1; patch_t* p2; - char name[10]; + size_t name_len = 10; + char name[name_len]; int stage; p1 = (patch_t*)W_CacheLumpName ("PFUB2", PU_LEVEL_SHARED); @@ -766,7 +767,7 @@ void F_BunnyScroll (void) ::g->laststage = stage; } - snprintf (name, strlen(name), "END%i",stage); + snprintf(name, name_len, "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 73b0ada8..5d1b83a5 100644 --- a/doomclassic/doom/hu_stuff.cpp +++ b/doomclassic/doom/hu_stuff.cpp @@ -319,7 +319,8 @@ void HU_Init(void) int i; int j; - char buffer[9]; + size_t buffer_len = 9; + char buffer[buffer_len]; shiftxform = english_shiftxform; @@ -327,7 +328,7 @@ void HU_Init(void) j = HU_FONTSTART; for (i=0;ihu_font[i] = (patch_t *) W_CacheLumpName(buffer, PU_STATIC_SHARED); }