From 39789bc6cb2d5a4f7a232ef1a9286fc6d6e3df53 Mon Sep 17 00:00:00 2001 From: Jeroen van Rijn Date: Mon, 12 May 2025 01:17:34 +0200 Subject: [PATCH] Make strings.to_cstring adhere to #optional_allocator_error --- core/strings/builder.odin | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/strings/builder.odin b/core/strings/builder.odin index e5a88527a..05382f04e 100644 --- a/core/strings/builder.odin +++ b/core/strings/builder.odin @@ -311,7 +311,7 @@ Returns: - res: A cstring of the Builder's buffer upon success - err: An optional allocator error if one occured, `nil` otherwise */ -to_cstring :: proc(b: ^Builder) -> (res: cstring, err: mem.Allocator_Error) { +to_cstring :: proc(b: ^Builder) -> (res: cstring, err: mem.Allocator_Error) #optional_allocator_error { n := append(&b.buf, 0) or_return if n != 1 { return nil, .Out_Of_Memory