diff options
Diffstat (limited to 'core/strings')
| -rw-r--r-- | core/strings/strings.odin | 4 |
1 files changed, 2 insertions, 2 deletions
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 } |