mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-23 05:42:29 +00:00
Return error on fopen(NULL)
https://sqlite.org/forum/forumpost/d1c96a9032e564f8
This commit is contained in:
parent
7ab4630cc9
commit
2bad436abf
2 changed files with 13 additions and 9 deletions
|
@ -58,6 +58,10 @@ FILE *fopen(const char *pathname, const char *mode) {
|
|||
FILE *f = 0;
|
||||
bool noclose;
|
||||
int fd, flags;
|
||||
if (!pathname) {
|
||||
efault();
|
||||
return 0;
|
||||
}
|
||||
flags = fopenflags(mode);
|
||||
pathname = fixpathname(pathname, flags);
|
||||
if ((fd = openpathname(pathname, flags, &noclose)) != -1) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue