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);