소스 검색

Merge pull request #5648 from thetarnav/handle-allocator-error-in-read-entire-file

Handle allocator error when appending in read_entire_file_from_file
gingerBill 1 주 전
부모
커밋
3bbf3641a1
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      core/os/os2/file_util.odin

+ 1 - 1
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