mirror of
https://github.com/odin-lang/Odin.git
synced 2026-06-07 02:54:18 +00:00
Fix os.read_entire_file
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user