garbage is allowed in the fdopen mode string

This commit is contained in:
eck 1990-04-24 09:40:47 +00:00
parent 470bb82342
commit 536b12010f

View file

@ -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) {