Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Johnston <jjohnstn@redhat.com>2000-02-25 22:52:27 +0300
committerJeff Johnston <jjohnstn@redhat.com>2000-02-25 22:52:27 +0300
commitdbaf37cf8373d36e8b00c82ef180d5144523b33c (patch)
treef7f5120c0e085a96289fd3dd3f6cea49c6ceb47d /newlib/libc
parente53d3a5d95b7c476569007171bb69c3b6302431d (diff)
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].
Diffstat (limited to 'newlib/libc')
-rw-r--r--newlib/libc/stdio/flags.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/newlib/libc/stdio/flags.c b/newlib/libc/stdio/flags.c
index 6d62bd5bc..e448cca80 100644
--- a/newlib/libc/stdio/flags.c
+++ b/newlib/libc/stdio/flags.c
@@ -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