mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
Fix os.read_entire_file
This commit is contained in:
+1
-1
@@ -85,10 +85,10 @@ read_entire_file :: proc(name: string) -> (data: []byte, success: bool) {
|
|||||||
if data == nil {
|
if data == nil {
|
||||||
return nil, false;
|
return nil, false;
|
||||||
}
|
}
|
||||||
defer if !success do delete(data);
|
|
||||||
|
|
||||||
bytes_read, read_err := read(fd, data);
|
bytes_read, read_err := read(fd, data);
|
||||||
if read_err != ERROR_NONE {
|
if read_err != ERROR_NONE {
|
||||||
|
delete(data);
|
||||||
return nil, false;
|
return nil, false;
|
||||||
}
|
}
|
||||||
return data[:bytes_read], true;
|
return data[:bytes_read], true;
|
||||||
|
|||||||
Reference in New Issue
Block a user