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

This commit is contained in:
Laytan Laats
2024-08-23 20:25:47 +02:00
parent ce53805d94
commit d410281766

View File

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