From 1b56b8912b5523557071e173d37d3cae184d5291 Mon Sep 17 00:00:00 2001 From: Nikolay Igotti Date: Wed, 7 Jun 2017 14:27:56 +0300 Subject: [PATCH] Fix size for wcstr --- Interop/Runtime/src/main/kotlin/kotlinx/cinterop/Utils.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Interop/Runtime/src/main/kotlin/kotlinx/cinterop/Utils.kt b/Interop/Runtime/src/main/kotlin/kotlinx/cinterop/Utils.kt index 5d5e733cca4..3ed3774c6fe 100644 --- a/Interop/Runtime/src/main/kotlin/kotlinx/cinterop/Utils.kt +++ b/Interop/Runtime/src/main/kotlin/kotlinx/cinterop/Utils.kt @@ -311,7 +311,7 @@ val String.wcstr: CValues get() { val chars = CharArray(this.length, { i -> this.get(i)}) return object : CValues() { - override val size get() = chars.size + 1 + override val size get() = 2 * (chars.size + 1) override fun getPointer(placement: NativePlacement): CPointer { val result = placement.allocArray(chars.size + 1)