aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen van Rijn <Kelimion@users.noreply.github.com>2025-05-12 01:17:34 +0200
committerJeroen van Rijn <Kelimion@users.noreply.github.com>2025-05-12 01:17:34 +0200
commit39789bc6cb2d5a4f7a232ef1a9286fc6d6e3df53 (patch)
tree431f47cd3fa8fa4fd7eba9a1dc6949f41a5e82d8
parentf6a39ca675d11ed7ac0cca223dec7e6f406deedd (diff)
Make strings.to_cstring adhere to #optional_allocator_error
-rw-r--r--core/strings/builder.odin2
1 files changed, 1 insertions, 1 deletions
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