1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-02-20 20:09:41 +00:00

Make sure MultiChar::data() constructs a valid string

mData may ultimately not be a valid C-string (e.g. if it contains 4 significant characters) so it may not necessarily be converted into a valid std::string
This commit is contained in:
Alexei Dobrohotov 2019-11-05 22:33:14 +03:00 committed by GitHub
parent 5ede09a6cd
commit a8843fa5a8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -165,7 +165,8 @@ namespace Compiler
std::string data()
{
return mData;
// NB: mLength is the number of the last element in the array
return std::string(mData, mLength + 1);
}
private: