COMMON: Initialize the String class for the std::string case

Otherwise, initWithCStr() will have nowhere to copy the string
data to, and will probably crash.
This commit is contained in:
Torbjörn Andersson
2018-04-09 07:23:24 +02:00
parent ca8502f33c
commit ef484a16b4
+1 -1
View File
@@ -101,7 +101,7 @@ String::String(const String &str)
assert(_str != 0);
}
String::String(const std::string &str) {
String::String(const std::string &str) : _size(0), _str(_storage) {
initWithCStr(str.c_str(), str.size());
}