fclose properly, 0 on coreio_open fail
This commit is contained in:
parent
4084fd1ced
commit
0ae8e0ebc8
|
@ -191,6 +191,11 @@ core_file* core_fopen(const char* filename)
|
|||
}
|
||||
} else {
|
||||
rv->f = fopen(filename, "rb");
|
||||
|
||||
if (!rv->f) {
|
||||
delete rv;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return (core_file*)rv;
|
||||
|
@ -232,7 +237,7 @@ int core_fclose(core_file* fc)
|
|||
CORE_FILE* f = (CORE_FILE*)fc;
|
||||
|
||||
if (f->f) {
|
||||
fclose((FILE*)f);
|
||||
fclose(f->f);
|
||||
}
|
||||
else {
|
||||
|
||||
|
|
Loading…
Reference in New Issue