From c4aeef0216c85670a92f390eee7539d67431876a Mon Sep 17 00:00:00 2001 From: Indev Date: Thu, 16 Oct 2025 15:16:23 +0300 Subject: [PATCH] Use str.resize(size) instead of str = str.substr(0, size) (ty lug <3) --- src/m_emotes.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/m_emotes.cpp b/src/m_emotes.cpp index a827fef1d..12886cc5a 100644 --- a/src/m_emotes.cpp +++ b/src/m_emotes.cpp @@ -81,7 +81,7 @@ void M_LoadEmotes(UINT16 wadnum) if (emote_name.size() > MAXEMOTENAME) { CONS_Alert(CONS_WARNING, "EMOTES: Emote name is too long, truncating. (file %s, line %d)\n", wadfiles[wadnum]->filename, linenum); - emote_name = emote_name.substr(0, MAXEMOTENAME); + emote_name.resize(MAXEMOTENAME); } emote = &emotes[emote_name]; @@ -128,7 +128,7 @@ void M_LoadEmotes(UINT16 wadnum) if (framelumpname.size() > 8) { CONS_Alert(CONS_WARNING, "EMOTES: Frame %d name is too long. (file %s, line %d)", numframes, wadfiles[wadnum]->filename, linenum); - framelumpname = framelumpname.substr(0, 8); + framelumpname.resize(8); } std::strncpy(emote->frames[numframes], framelumpname.c_str(), framelumpname.size()+1);