Use str.resize(size) instead of str = str.substr(0, size) (ty lug <3)
This commit is contained in:
parent
cef5e93c93
commit
c4aeef0216
1 changed files with 2 additions and 2 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue