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:
@ -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
|
||||
|
Reference in New Issue
Block a user