Skip to content

Commit

Permalink
Improve sys_buffer_to_string
Browse files Browse the repository at this point in the history
  • Loading branch information
luboslenco committed Nov 22, 2024
1 parent e3ed2e5 commit fd6ffc5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions armorcore/sources/ts/sys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit fd6ffc5

Please sign in to comment.