From 9ed4a2e730e6b187ea7e0e73919495c2aea83f82 Mon Sep 17 00:00:00 2001 From: jvdelisle Date: Fri, 18 Jan 2008 22:19:15 +0000 Subject: [PATCH] 2008-01-18 Jerry DeLisle * io/transfer.c (formatted_transfer_scalar): Set max_pos to the greater of the current max_pos or the newly calculated position. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@131640 138bc75d-0d04-0410-961f-82ee72b054a4 --- libgfortran/ChangeLog | 5 +++++ libgfortran/io/transfer.c | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index 3a81decfc8e4..25e239a6cffd 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,8 @@ +2008-01-18 Jerry DeLisle + + * io/transfer.c (formatted_transfer_scalar): Set max_pos to the greater + of the current max_pos or the newly calculated position. + 2008-01-18 Tobias Burnus * io/write.c (write_real): Increase default precision diff --git a/libgfortran/io/transfer.c b/libgfortran/io/transfer.c index 9b9e28ef3b7a..da3e3f2000c5 100644 --- a/libgfortran/io/transfer.c +++ b/libgfortran/io/transfer.c @@ -948,9 +948,12 @@ formatted_transfer_scalar (st_parameter_dt *dtp, bt type, void *p, int len, { if (dtp->u.p.skips > 0) { + int tmp; write_x (dtp, dtp->u.p.skips, dtp->u.p.pending_spaces); - dtp->u.p.max_pos = (int)(dtp->u.p.current_unit->recl - - dtp->u.p.current_unit->bytes_left); + tmp = (int)(dtp->u.p.current_unit->recl + - dtp->u.p.current_unit->bytes_left); + dtp->u.p.max_pos = + dtp->u.p.max_pos > tmp ? dtp->u.p.max_pos : tmp; } if (dtp->u.p.skips < 0) { -- 2.11.4.GIT