]> sourceware.org Git - newlib-cygwin.git/commitdiff
Fri Feb 25 14:50:50 2000 Jeff Johnston <jjohnstn@cygnus.com>
authorJeff Johnston <jjohnstn@redhat.com>
Fri, 25 Feb 2000 19:52:27 +0000 (19:52 +0000)
committerJeff Johnston <jjohnstn@redhat.com>
Fri, 25 Feb 2000 19:52:27 +0000 (19:52 +0000)
        * libc/stdio/flags.c (__sflags): Added check that mode[1]
        is non-null before looking at mode[2].

newlib/ChangeLog
newlib/libc/stdio/flags.c

index 6adf4f4d8fa17a87decf2ea1da61ba4023e29f70..2e39d2b074804597371f542ad79dacd0fa1d35ae 100644 (file)
@@ -1,3 +1,8 @@
+Fri Feb 25 14:50:50 2000  Jeff Johnston <jjohnstn@cygnus.com>
+
+       * libc/stdio/flags.c (__sflags): Added check that mode[1]
+       is non-null before looking at mode[2].
+
 Thu Feb 24 11:43:00 2000  Ran Cabell <rcabell@norfolk.infi.net>
 
        * libm/mathfp/sf_atan2.c: Fix atan2 typo for _DOUBLE_IS_32_BITS.
index 6d62bd5bc20055fa69580bbf69f38d8e7757f028..e448cca8028bf5d146fd9dc8d54cd12c763360f8 100644 (file)
@@ -61,19 +61,19 @@ __sflags (ptr, mode, optr)
       ptr->_errno = EINVAL;
       return (0);
     }
-  if (mode[1] == '+' || mode[2] == '+')
+  if (mode[1] && (mode[1] == '+' || mode[2] == '+'))
     {
       ret = __SRW;
       m = O_RDWR;
     }
-  if (mode[1] == 'b' || mode[2] == 'b')
+  if (mode[1] && (mode[1] == 'b' || mode[2] == 'b'))
     {
 #ifdef O_BINARY
       m |= O_BINARY;
 #endif
     }
 #ifdef __CYGWIN__
-  else if (mode[1] == 't' || mode[2] == 't')
+  else if (mode[1] && (mode[1] == 't' || mode[2] == 't'))
 #else
   else
 #endif
This page took 0.0471549999999999 seconds and 5 git commands to generate.