aboutsummaryrefslogtreecommitdiff
path: root/libf2c/libU77/fnum_.c
diff options
context:
space:
mode:
authorToon Moene <toon@moene.indiv.nluug.nl>2003-09-21 18:16:46 +0200
committerToon Moene <toon@gcc.gnu.org>2003-09-21 16:16:46 +0000
commite94915267b3602b8a6be03ef27709b67343a8ac6 (patch)
tree254e8d1bd815a14e9ce057b077058c4462f48580 /libf2c/libU77/fnum_.c
parentfa543fdda1fb1769de6c5101ce8f6722501be71f (diff)
downloadgcc-e94915267b3602b8a6be03ef27709b67343a8ac6.zip
gcc-e94915267b3602b8a6be03ef27709b67343a8ac6.tar.gz
gcc-e94915267b3602b8a6be03ef27709b67343a8ac6.tar.bz2
re PR libf2c/11918 (isatty does not call f_init)
2003-09-21 Toon Moene <toon@moene.indiv.nluug.nl> PR libf2c/11918 * fstat_.c: Call f_init(). * isatty_.c: Ditto. * fnum_.c: Check file descriptor before handing it back. From-SVN: r71628
Diffstat (limited to 'libf2c/libU77/fnum_.c')
-rw-r--r--libf2c/libU77/fnum_.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libf2c/libU77/fnum_.c b/libf2c/libU77/fnum_.c
index daf8f3d..27cadec 100644
--- a/libf2c/libU77/fnum_.c
+++ b/libf2c/libU77/fnum_.c
@@ -27,6 +27,10 @@ G77_fnum_0 (integer * lunit)
{
if (*lunit >= MXUNIT || *lunit < 0)
err (1, 101, "fnum");
+
+ if (f__units[*lunit].ufd == NULL)
+ err (1, 114, "fnum");
+
/* f__units is a table of descriptions for the unit numbers (defined
in io.h). Use file descriptor (ufd) and fileno rather than udev
field since udev is unix specific */