Fix os.read_entire_file
This commit is contained in:
1 parent
2ce1f4ba9f
commit
a0d0e93475
1 file changed
+1
-1
+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