aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerry DeLisle <jvdelisle@gcc.gnu.org>2008-01-18 22:19:15 +0000
committerJerry DeLisle <jvdelisle@gcc.gnu.org>2008-01-18 22:19:15 +0000
commit6c540522baf73cc0c90baae3e66e1bfa0f51b049 (patch)
treeadc17376a79e9e8f8f0b079a3c49d0e77aa8cfbd
parent810143349de3834a6b52455b209da75e3f0db9ca (diff)
downloadgcc-6c540522baf73cc0c90baae3e66e1bfa0f51b049.zip
gcc-6c540522baf73cc0c90baae3e66e1bfa0f51b049.tar.gz
gcc-6c540522baf73cc0c90baae3e66e1bfa0f51b049.tar.bz2
transfer.c (formatted_transfer_scalar): Set max_pos to the greater of the current max_pos or the newly calculated position.
2008-01-18 Jerry DeLisle <jvdelisle@gcc.gnu.org> * io/transfer.c (formatted_transfer_scalar): Set max_pos to the greater of the current max_pos or the newly calculated position. From-SVN: r131640
-rw-r--r--libgfortran/ChangeLog5
-rw-r--r--libgfortran/io/transfer.c7
2 files changed, 10 insertions, 2 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index 3a81dec..25e239a 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,8 @@
+2008-01-18 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ * 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 <burnus@net-b.de>
* io/write.c (write_real): Increase default precision
diff --git a/libgfortran/io/transfer.c b/libgfortran/io/transfer.c
index 9b9e28e..da3e3f2 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)
{