From: Jack Jansen Date: Mon, 14 Aug 1995 12:21:50 +0000 (+0000) Subject: Added missing initializer and extra error check. X-Git-Tag: v1.3b1~41 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9c45a6504fbc828ed37778674b9ccabae27ae543;p=thirdparty%2FPython%2Fcpython.git Added missing initializer and extra error check. --- diff --git a/Mac/mwerks/mwfopenrf.c b/Mac/mwerks/mwfopenrf.c index fa2a39b0c0e8..cd8615a123e9 100644 --- a/Mac/mwerks/mwfopenrf.c +++ b/Mac/mwerks/mwfopenrf.c @@ -18,7 +18,7 @@ fopenRF(name, mode) int fd; FILE *fp; int modebits = -1; - int extramodebits; + int extramodebits = 0; char *modep; for(modep=mode; *modep; modep++) { @@ -39,6 +39,10 @@ fopenRF(name, mode) return NULL; } } + if ( modebits == -1 ) { + errno = EINVAL; + return NULL; + } fd = open(name, modebits|extramodebits|O_RSRC); if ( fd < 0 ) return NULL;