Clean up stringop-overflow=4 warnings

This commit is contained in:
Alam Ed Arias 2024-02-20 11:48:59 -05:00
parent a8a92a57a7
commit 53d74e7f89
3 changed files with 2 additions and 7 deletions

View file

@ -311,10 +311,8 @@ target_compile_options(SRB2SDL2 PRIVATE
$<$<VERSION_GREATER_EQUAL:$<C_COMPILER_VERSION>,8.1.0>:
-Wno-error=format-overflow
-Wno-error=stringop-truncation
-Wno-error=stringop-overflow
-Wno-format-overflow
-Wno-stringop-truncation
-Wno-stringop-overflow
-Wno-error=multistatement-macros
>

View file

@ -136,10 +136,8 @@ endif
ifdef GCC81
WFLAGS+=-Wno-error=format-overflow
WFLAGS+=-Wno-error=stringop-truncation
WFLAGS+=-Wno-error=stringop-overflow
WFLAGS+=-Wno-format-overflow
WFLAGS+=-Wno-stringop-truncation
WFLAGS+=-Wno-stringop-overflow
WFLAGS+=-Wno-error=multistatement-macros
endif

View file

@ -4384,11 +4384,10 @@ void F_GetPromptPageByNamedTag(const char *tag, INT32 *promptnum, INT32 *pagenum
if (!tag || !tag[0])
return;
strncpy(suffixedtag, tag, 33);
suffixedtag[32] = 0;
strncpy(suffixedtag, tag, sizeof(suffixedtag)-1);
if (tutorialmode)
suffixed = F_GetTextPromptTutorialTag(suffixedtag, 33);
suffixed = F_GetTextPromptTutorialTag(suffixedtag, sizeof(suffixedtag)-1);
for (*promptnum = 0 + tutorialpromptnum; *promptnum < MAX_PROMPTS; (*promptnum)++)
{