1
0
forked from mirrors/0ad

Use .assign instead of operator=.

This was SVN commit r17634.
This commit is contained in:
leper
2016-01-11 20:57:03 +00:00
parent f4898c18d8
commit 2ec4d87abf
+1 -1
View File
@@ -177,7 +177,7 @@ template<> bool ScriptInterface::FromJSVal<std::string>(JSContext* cx, JS::Handl
char* ch = JS_EncodeString(cx, str); // chops off high byte of each char16_t
if (!ch)
FAIL("JS_EncodeString failed"); // out of memory
out = std::string(ch, ch + JS_GetStringLength(str));
out.assign(ch, ch + JS_GetStringLength(str));
JS_free(cx, ch);
return true;
}