summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ffi.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/ffi.c b/ffi.c
index aebd8234..fe55e642 100644
--- a/ffi.c
+++ b/ffi.c
@@ -2870,8 +2870,7 @@ static val ffi_char_array_get(struct txr_ffi_type *tft, mem_t *src,
} else if (nelem == 0) {
return null_string;
} else {
- wchar_t *wch = utf8_dup_from_buf(chptr, nelem);
- return string_own(wch);
+ return string_utf8_from_buf(chptr, nelem);
}
}
@@ -2906,8 +2905,7 @@ static val ffi_zchar_array_get(struct txr_ffi_type *tft, mem_t *src,
} else if (memchr(chptr, 0, nelem)) {
return string_utf8(chptr);
} else {
- wchar_t *wch = utf8_dup_from_buf(chptr, nelem);
- return string_own(wch);
+ return string_utf8_from_buf(chptr, nelem);
}
}