Handle optional allocator error when appending read bytes in read_entire_file_from_file

This commit is contained in:
Damian Tarnawski
2025-09-02 13:42:25 +02:00
parent 7e3e15aee6
commit cdca345d74

View File

@@ -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