From a0d0e93475458a5a9018ecd76e02fd6096d7f94e Mon Sep 17 00:00:00 2001 From: gingerBill Date: Thu, 12 Mar 2020 23:45:46 +0000 Subject: [PATCH] Fix os.read_entire_file --- core/os/os.odin | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/os/os.odin b/core/os/os.odin index 52efa7924..a5926834f 100644 --- a/core/os/os.odin +++ b/core/os/os.odin @@ -85,10 +85,10 @@ read_entire_file :: proc(name: string) -> (data: []byte, success: bool) { if data == nil { return nil, false; } - defer if !success do delete(data); bytes_read, read_err := read(fd, data); if read_err != ERROR_NONE { + delete(data); return nil, false; } return data[:bytes_read], true;