mirror of
https://github.com/odin-lang/Odin.git
synced 2026-02-15 07:43:13 +00:00
Make strings.to_cstring adhere to #optional_allocator_error
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user