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].
This commit is contained in:
Jeff Johnston 2000-02-25 19:52:27 +00:00
parent e53d3a5d95
commit dbaf37cf83
2 changed files with 8 additions and 3 deletions

View 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> 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. * libm/mathfp/sf_atan2.c: Fix atan2 typo for _DOUBLE_IS_32_BITS.

View File

@ -61,19 +61,19 @@ __sflags (ptr, mode, optr)
ptr->_errno = EINVAL; ptr->_errno = EINVAL;
return (0); return (0);
} }
if (mode[1] == '+' || mode[2] == '+') if (mode[1] && (mode[1] == '+' || mode[2] == '+'))
{ {
ret = __SRW; ret = __SRW;
m = O_RDWR; m = O_RDWR;
} }
if (mode[1] == 'b' || mode[2] == 'b') if (mode[1] && (mode[1] == 'b' || mode[2] == 'b'))
{ {
#ifdef O_BINARY #ifdef O_BINARY
m |= O_BINARY; m |= O_BINARY;
#endif #endif
} }
#ifdef __CYGWIN__ #ifdef __CYGWIN__
else if (mode[1] == 't' || mode[2] == 't') else if (mode[1] && (mode[1] == 't' || mode[2] == 't'))
#else #else
else else
#endif #endif