From 3d092c45bf57b3f9df0892e8d95a6284106a86c2 Mon Sep 17 00:00:00 2001 From: Jerry DeLisle Date: Tue, 9 Aug 2005 01:56:04 +0000 Subject: [PATCH] re PR libfortran/23154 (Currupt string and segfault in formatted read.) 2005-08-08 Jerry DeLisle PR libfortran/23154 * io/transfer.c (data_transfer_init): Initialize current_unit->bytes_left for a read. From-SVN: r102893 --- libgfortran/ChangeLog | 6 ++++++ libgfortran/io/transfer.c | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index aed0280b7c1..d733fa36b6c 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,9 @@ +2005-08-08 Jerry DeLisle + + PR libfortran/23154 + * io/transfer.c (data_transfer_init): Initialize + current_unit->bytes_left for a read. + 2005-08-07 Janne Blomqvist PR fortran/22390 diff --git a/libgfortran/io/transfer.c b/libgfortran/io/transfer.c index 72cc2b9bcbb..00e8c3101d1 100644 --- a/libgfortran/io/transfer.c +++ b/libgfortran/io/transfer.c @@ -1028,7 +1028,9 @@ data_transfer_init (int read_flag) { current_unit->recl = file_length(current_unit->s); if (g.mode==WRITING) - empty_internal_buffer (current_unit->s); + empty_internal_buffer (current_unit->s); + else + current_unit->bytes_left = current_unit->recl; } /* Check the action. */ -- 2.30.2