X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=functions%2F_PDCLIB%2Ffilemode.c;h=c6066f899b13552edc46173bfbceb032b8e26e32;hb=026148e2e90368c0b23192f506e15aa6197105aa;hp=ded5408542576274ad43a910a1e3b9d2776b4e6b;hpb=219271fd548949abce8bd75c34dd42e519418fc4;p=pdclib diff --git a/functions/_PDCLIB/filemode.c b/functions/_PDCLIB/filemode.c index ded5408..c6066f8 100644 --- a/functions/_PDCLIB/filemode.c +++ b/functions/_PDCLIB/filemode.c @@ -9,12 +9,15 @@ #include #ifndef REGTEST +#include <_PDCLIB_io.h> /* Helper function that parses the C-style mode string passed to fopen() into the PDCLib flags FREAD, FWRITE, FAPPEND, FRW (read-write) and FBIN (binary mode). */ unsigned int _PDCLIB_filemode( char const * const mode ) { + if(!mode) return 0; + unsigned rc = 0; switch ( mode[0] ) {