Browse Source

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

Laytan Laats 11 months ago
parent
commit
d410281766
1 changed files with 1 additions and 1 deletions
  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
 		return
 	}
 	}
 
 
-	if has_size {
+	if has_size && size > 0 {
 		total: int
 		total: int
 		data = make([]byte, size, allocator) or_return
 		data = make([]byte, size, allocator) or_return
 		for total < len(data) {
 		for total < len(data) {