From 7cf62f00c34b98cc2f8acab75d5259ff4fc2c6f6 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Thu, 16 May 2024 16:30:45 +0100 Subject: Correct #soa RTTI usage --- core/strings/strings.odin | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core/strings') diff --git a/core/strings/strings.odin b/core/strings/strings.odin index 13c53f48e..101ba72a9 100644 --- a/core/strings/strings.odin +++ b/core/strings/strings.odin @@ -91,8 +91,8 @@ Inputs: Returns: - res: A string created from the null-terminated byte pointer and length */ -string_from_null_terminated_ptr :: proc(ptr: ^byte, len: int) -> (res: string) { - s := transmute(string)mem.Raw_String{ptr, len} +string_from_null_terminated_ptr :: proc(ptr: [^]byte, len: int) -> (res: string) { + s := string(ptr[:len]) s = truncate_to_byte(s, 0) return s } -- cgit v1.2.3