瀏覽代碼

os2: do read_entire_file in parts if the file size is 0

Laytan Laats 1 年之前
父節點
當前提交
d410281766
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      core/os/os2/file_util.odin

+ 1 - 1
core/os/os2/file_util.odin

@@ -130,7 +130,7 @@ read_entire_file_from_file :: proc(f: ^File, allocator: runtime.Allocator) -> (d
 		return
 	}
 
-	if has_size {
+	if has_size && size > 0 {
 		total: int
 		data = make([]byte, size, allocator) or_return
 		for total < len(data) {