From d4102817665e044b092f3c136802373fd830eb4d Mon Sep 17 00:00:00 2001 From: Laytan Laats Date: Fri, 23 Aug 2024 20:25:47 +0200 Subject: [PATCH] os2: do read_entire_file in parts if the file size is 0 --- core/os/os2/file_util.odin | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/os/os2/file_util.odin b/core/os/os2/file_util.odin index 2dc457f058f..e328f9a02e4 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) {