Fix type in conversion to ByteArray

This commit is contained in:
igotti-google
2017-08-26 11:50:10 +03:00
parent 7e666f2d90
commit 7fadfa5a0c
+1 -1
View File
@@ -740,7 +740,7 @@ OBJ_GETTER(Kotlin_String_toUtf8Array, KString thiz, KInt start, KInt size) {
KStdString utf8;
utf8::unchecked::utf16to8(utf16, utf16 + size, back_inserter(utf8));
ArrayHeader* result = AllocArrayInstance(
theByteArrayTypeInfo, utf8.size() + 1, OBJ_RESULT)->array();
theByteArrayTypeInfo, utf8.size(), OBJ_RESULT)->array();
::memcpy(ByteArrayAddressOfElementAt(result, 0), utf8.c_str(), utf8.size());
RETURN_OBJ(result->obj());
}