Codechange: do not make a string valid in place, to then copy it
This commit is contained in:
@@ -2651,12 +2651,9 @@ static ChangeInfoResult LoadTranslationTable(uint gvid, int numinfo, ByteReader
|
||||
*/
|
||||
static std::string ReadDWordAsString(ByteReader *reader)
|
||||
{
|
||||
char output[5];
|
||||
for (int i = 0; i < 4; i++) output[i] = reader->ReadByte();
|
||||
output[4] = '\0';
|
||||
StrMakeValidInPlace(output, lastof(output));
|
||||
|
||||
return std::string(output);
|
||||
std::string output;
|
||||
for (int i = 0; i < 4; i++) output.push_back(reader->ReadByte());
|
||||
return StrMakeValid(output);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user