summaryrefslogtreecommitdiffstats
path: root/Mac/mwerks
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>1995-08-14 12:21:50 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>1995-08-14 12:21:50 (GMT)
commit9c45a6504fbc828ed37778674b9ccabae27ae543 (patch)
tree4dd44c95b06b3856c6e598f90b6f31055e1fb999 /Mac/mwerks
parent9062fa2fb54e1c47aa314eef74b314d128a6b2c4 (diff)
downloadcpython-9c45a6504fbc828ed37778674b9ccabae27ae543.zip
cpython-9c45a6504fbc828ed37778674b9ccabae27ae543.tar.gz
cpython-9c45a6504fbc828ed37778674b9ccabae27ae543.tar.bz2
Added missing initializer and extra error check.
Diffstat (limited to 'Mac/mwerks')
-rw-r--r--Mac/mwerks/mwfopenrf.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/Mac/mwerks/mwfopenrf.c b/Mac/mwerks/mwfopenrf.c
index fa2a39b..cd8615a 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;