Fix os.read_entire_file

This commit is contained in:
gingerBill
2020-03-12 23:45:46 +00:00
parent 2ce1f4ba9f
commit a0d0e93475

View File

@@ -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;