diff --git a/core/strings/strings.odin b/core/strings/strings.odin index e99a1bfb4..52230f572 100644 --- a/core/strings/strings.odin +++ b/core/strings/strings.odin @@ -25,7 +25,7 @@ Returns: clone :: proc(s: string, allocator := context.allocator, loc := #caller_location) -> (res: string, err: mem.Allocator_Error) #optional_allocator_error { c := make([]byte, len(s), allocator, loc) or_return copy(c, s) - return string(c[:len(s)]), nil + return string(c), nil } /* Clones a string safely (returns early with an allocation error on failure)