aboutsummaryrefslogtreecommitdiff
path: root/libgfortran/io/unix.c
diff options
context:
space:
mode:
authorPaul Brook <paul@codesourcery.com>2004-08-31 15:53:31 +0000
committerPaul Brook <pbrook@gcc.gnu.org>2004-08-31 15:53:31 +0000
commitbd72d66cb5f8450f631da7149bf066f865d56338 (patch)
treeeeec759a476bd4d9d5f8e220e891469fe79a14bb /libgfortran/io/unix.c
parentc789f36b216c9318b7f5fadb3a632f91513e3156 (diff)
downloadgcc-bd72d66cb5f8450f631da7149bf066f865d56338.zip
gcc-bd72d66cb5f8450f631da7149bf066f865d56338.tar.gz
gcc-bd72d66cb5f8450f631da7149bf066f865d56338.tar.bz2
transfer.c (read_sf): Rename uinty to readlen.
* io/transfer.c (read_sf): Rename uinty to readlen. Detect EOF. (finalize_transfer): Move setjmp after namlist IO. * io/unix.c (mem_alloc_r_at): Calculate remaining length correctly. testsuite/ * gfortran.dg/eof_1.f90: New test. From-SVN: r86831
Diffstat (limited to 'libgfortran/io/unix.c')
-rw-r--r--libgfortran/io/unix.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libgfortran/io/unix.c b/libgfortran/io/unix.c
index 0c65258..33d7fda 100644
--- a/libgfortran/io/unix.c
+++ b/libgfortran/io/unix.c
@@ -751,7 +751,7 @@ mem_alloc_r_at (unix_stream * s, int *len, gfc_offset where)
s->logical_offset = where + *len;
- n = (where - s->buffer_offset) - s->active;
+ n = s->buffer_offset + s->active - where;
if (*len > n)
*len = n;