aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamian Tarnawski <gthetarnav@gmail.com>2025-09-02 13:42:25 +0200
committerDamian Tarnawski <gthetarnav@gmail.com>2025-09-02 13:42:25 +0200
commitcdca345d7424c77e151a65e84c638b258f216d50 (patch)
treea5409da9cfbe70824232f92f6d7c466c33b5bff9
parent7e3e15aee6905839f85a0da259977a4c41c997b4 (diff)
Handle optional allocator error when appending read bytes in read_entire_file_from_file
-rw-r--r--core/os/os2/file_util.odin2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/os/os2/file_util.odin b/core/os/os2/file_util.odin
index 407c38f88..13d6db661 100644
--- a/core/os/os2/file_util.odin
+++ b/core/os/os2/file_util.odin
@@ -151,7 +151,7 @@ read_entire_file_from_file :: proc(f: ^File, allocator: runtime.Allocator) -> (d
n: int
n, err = read(f, buffer[:])
total += n
- append_elems(&out_buffer, ..buffer[:n])
+ append_elems(&out_buffer, ..buffer[:n]) or_return
if err != nil {
if err == .EOF || err == .Broken_Pipe {
err = nil