Fix type in conversion to ByteArray
This commit is contained in:
@@ -740,7 +740,7 @@ OBJ_GETTER(Kotlin_String_toUtf8Array, KString thiz, KInt start, KInt size) {
|
|||||||
KStdString utf8;
|
KStdString utf8;
|
||||||
utf8::unchecked::utf16to8(utf16, utf16 + size, back_inserter(utf8));
|
utf8::unchecked::utf16to8(utf16, utf16 + size, back_inserter(utf8));
|
||||||
ArrayHeader* result = AllocArrayInstance(
|
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());
|
::memcpy(ByteArrayAddressOfElementAt(result, 0), utf8.c_str(), utf8.size());
|
||||||
RETURN_OBJ(result->obj());
|
RETURN_OBJ(result->obj());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user