]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Added missing initializer and extra error check.
authorJack Jansen <jack.jansen@cwi.nl>
Mon, 14 Aug 1995 12:21:50 +0000 (12:21 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Mon, 14 Aug 1995 12:21:50 +0000 (12:21 +0000)
Mac/mwerks/mwfopenrf.c

index fa2a39b0c0e8b634c00329853b024f16088d1efc..cd8615a123e969251ead1f05e838c008477ef70c 100644 (file)
@@ -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;