]> pd.if.org Git - pdclib.old/blobdiff - functions/_PDCLIB/filemode.c
PDCLIB-15 PDCLIB-16:
[pdclib.old] / functions / _PDCLIB / filemode.c
index ded5408542576274ad43a910a1e3b9d2776b4e6b..c6066f899b13552edc46173bfbceb032b8e26e32 100644 (file)
@@ -9,12 +9,15 @@
 #include <stddef.h>
 
 #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] )
     {