#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] )
{