From bd72d66cb5f8450f631da7149bf066f865d56338 Mon Sep 17 00:00:00 2001 From: Paul Brook Date: Tue, 31 Aug 2004 15:53:31 +0000 Subject: 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 --- libgfortran/io/unix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libgfortran/io/unix.c') 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; -- cgit v1.1