From: Jerry DeLisle Date: Tue, 9 Aug 2005 01:56:04 +0000 (+0000) Subject: re PR libfortran/23154 (Currupt string and segfault in formatted read.) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3d092c45bf57b3f9df0892e8d95a6284106a86c2;p=gcc.git 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 --- 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. */