diff options
| author | Laytan Laats <laytanlaats@hotmail.com> | 2024-08-23 20:25:47 +0200 |
|---|---|---|
| committer | Laytan Laats <laytanlaats@hotmail.com> | 2024-08-23 20:25:47 +0200 |
| commit | d4102817665e044b092f3c136802373fd830eb4d (patch) | |
| tree | 6057fbce9c0ba1c12da726a49ddcd1c505fba489 | |
| parent | ce53805d94eefbecac49d36407b0cc707bc988ff (diff) | |
os2: do read_entire_file in parts if the file size is 0
| -rw-r--r-- | core/os/os2/file_util.odin | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/os/os2/file_util.odin b/core/os/os2/file_util.odin index 2dc457f05..e328f9a02 100644 --- a/core/os/os2/file_util.odin +++ b/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) { |