From 536b12010ff9e2874aee65df8c31d93e32bcb6e5 Mon Sep 17 00:00:00 2001 From: eck Date: Tue, 24 Apr 1990 09:40:47 +0000 Subject: [PATCH] garbage is allowed in the fdopen mode string --- lang/cem/libcc.ansi/misc/fdopen.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lang/cem/libcc.ansi/misc/fdopen.c b/lang/cem/libcc.ansi/misc/fdopen.c index f8dc9f547..d1df2e2a7 100644 --- a/lang/cem/libcc.ansi/misc/fdopen.c +++ b/lang/cem/libcc.ansi/misc/fdopen.c @@ -34,13 +34,15 @@ fdopen(int fd, const char *mode) while(*mode) { switch(*mode++) { case 'b': - break; + continue; case '+': flags |= _IOREAD | _IOWRITE; - break; + continue; + /* The sequence may be followed by aditional characters */ default: - return (FILE *)NULL; + break; } + break; } if ((stream = (FILE *) malloc(sizeof(FILE))) == NULL) {