From fd6ffc5cab8b1bc9e005f684d4d0da2c3b7fbb83 Mon Sep 17 00:00:00 2001 From: luboslenco Date: Fri, 22 Nov 2024 22:43:08 +0100 Subject: [PATCH] Improve sys_buffer_to_string --- armorcore/sources/ts/sys.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/armorcore/sources/ts/sys.ts b/armorcore/sources/ts/sys.ts index ed3045733..da64f357c 100644 --- a/armorcore/sources/ts/sys.ts +++ b/armorcore/sources/ts/sys.ts @@ -352,9 +352,9 @@ function sys_display_frequency(): i32 { } function sys_buffer_to_string(b: buffer_t): string { - let str: u8_array_t = u8_array_create(b.length + 1); - memcpy(str.buffer, b.buffer, b.length); - return (any_ptr)str.buffer; + let str: string = string_alloc(b.length + 1); + memcpy(str, b.buffer, b.length); + return str; } function sys_string_to_buffer(str: string): buffer_t {