Skip to content

Commit

Permalink
os2: do read_entire_file in parts if the file size is 0
Browse files Browse the repository at this point in the history
  • Loading branch information
laytan committed Aug 23, 2024
1 parent ce53805 commit d410281
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/os/os2/file_util.odin
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit d410281

Please sign in to comment.