Interop/Runtime: fix major bug: alloc C strings using correct placement

This commit is contained in:
Svyatoslav Scherbina
2017-02-02 12:20:56 +07:00
committed by SvyatoslavScherbina
parent 49815f72e0
commit 6939398521
@@ -187,7 +187,7 @@ fun CString.Companion.fromString(str: String?, placement: NativePlacement): CStr
val bytes = encodeToUtf8(str) // TODO: encoding
val len = bytes.size
val nativeBytes = nativeHeap.allocArray<CInt8Var>(len + 1)
val nativeBytes = placement.allocArray<CInt8Var>(len + 1)
nativeMemUtils.putByteArray(bytes, nativeBytes[0], len)
nativeBytes[len].value = 0