COMMON: Fix creating a String from a U32String

There were memory issues due to class member variables not initialized
by the constructor.
This commit is contained in:
Thierry Crozat 2020-08-18 01:23:01 +01:00 committed by Eugene Sandulenko
parent 733df0bfa1
commit 94035cf7aa

View file

@ -125,7 +125,9 @@ String::String(char c)
_size = (c == 0) ? 0 : 1;
}
String::String(const U32String &str) {
String::String(const U32String &str)
: _size(0), _str(_storage) {
_storage[0] = 0;
*this = String(str.encode());
}