Skip to content
This repository has been archived by the owner on Aug 10, 2021. It is now read-only.

Commit

Permalink
Fix toKStringFromUtf32 (#3903)
Browse files Browse the repository at this point in the history
Remove null terminator from returned String
  • Loading branch information
Dominaezzz authored Mar 4, 2020
1 parent 2730755 commit 7e9f8b5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Interop/Runtime/src/main/kotlin/kotlinx/cinterop/Utils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -532,8 +532,8 @@ public fun CPointer<IntVar>.toKStringFromUtf32(): String {
var toIndex = 0
while (true) {
val value = nativeBytes[fromIndex++]
toIndex++
if (value == 0) break
toIndex++
if (value >= 0x10000 && value <= 0x10ffff) {
toIndex++
}
Expand Down

0 comments on commit 7e9f8b5

Please sign in to comment.