1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-05-12 17:41:27 +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() std::string data()
{ {
return mData; // NB: mLength is the number of the last element in the array
return std::string(mData, mLength + 1);
} }
private: private: