diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 1995-08-14 12:21:50 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 1995-08-14 12:21:50 (GMT) |
commit | 9c45a6504fbc828ed37778674b9ccabae27ae543 (patch) | |
tree | 4dd44c95b06b3856c6e598f90b6f31055e1fb999 /Mac/mwerks/mwfopenrf.c | |
parent | 9062fa2fb54e1c47aa314eef74b314d128a6b2c4 (diff) | |
download | cpython-9c45a6504fbc828ed37778674b9ccabae27ae543.zip cpython-9c45a6504fbc828ed37778674b9ccabae27ae543.tar.gz cpython-9c45a6504fbc828ed37778674b9ccabae27ae543.tar.bz2 |
Added missing initializer and extra error check.
Diffstat (limited to 'Mac/mwerks/mwfopenrf.c')
-rw-r--r-- | Mac/mwerks/mwfopenrf.c | 6 |
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; |