diff --git a/lang/cem/libcc.ansi/stdio/fopen.c b/lang/cem/libcc.ansi/stdio/fopen.c index bc2e1ed6b..af11acd57 100644 --- a/lang/cem/libcc.ansi/stdio/fopen.c +++ b/lang/cem/libcc.ansi/stdio/fopen.c @@ -73,14 +73,16 @@ fopen(const char *name, const char *mode) while (*mode) { switch(*mode++) { case 'b': - break; + continue; case '+': rwmode = O_RDWR; flags |= _IOREAD | _IOWRITE; - break; + continue; + /* The sequence may be followed by additional characters */ default: - return (FILE *)NULL; + break; } + break; } /* Perform a creat() when the file should be truncated or when diff --git a/lang/cem/libcc.ansi/stdio/freopen.c b/lang/cem/libcc.ansi/stdio/freopen.c index 41887f861..32965362c 100644 --- a/lang/cem/libcc.ansi/stdio/freopen.c +++ b/lang/cem/libcc.ansi/stdio/freopen.c @@ -56,14 +56,16 @@ freopen(const char *name, const char *mode, FILE *stream) while (*mode) { switch(*mode++) { case 'b': - break; + continue; case '+': rwmode = O_RDWR; flags |= _IOREAD | _IOWRITE; - break; + continue; + /* The sequence may be followed by aditional characters */ default: - return (FILE *)NULL; + break; } + break; } if ((rwflags & O_TRUNC)