X-Git-Url: https://pd.if.org/git/?p=pdclib;a=blobdiff_plain;f=functions%2Fstdio%2Ffopen.c;h=ff8e8e8a08862ea7679d54d3457d41531c3a7599;hp=18b7b3ae4df8e2cf5646bb87fc88fc20bedc8eba;hb=04ff9a4a124eaa87d5d26d90077fb4ed15f3277f;hpb=9b38723dad57f9eb49abdb2a6cde699c658c83fc diff --git a/functions/stdio/fopen.c b/functions/stdio/fopen.c index 18b7b3a..ff8e8e8 100644 --- a/functions/stdio/fopen.c +++ b/functions/stdio/fopen.c @@ -20,6 +20,10 @@ FILE * fopen( const char * _PDCLIB_restrict filename, const char * _PDCLIB_restrict mode ) { int imode = _PDCLIB_filemode( mode ); + + if( imode == 0 || filename == NULL ) + return NULL; + _PDCLIB_fd_t fd = _PDCLIB_open( filename, imode ); if(fd == _PDCLIB_NOHANDLE) { return NULL;