diff options
author | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2007-07-09 00:15:15 +0000 |
---|---|---|
committer | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2007-07-09 00:15:15 +0000 |
commit | 8d917a24a765d8a0eff7a44e73e2104851feb8df (patch) | |
tree | 4a9c76ca6c95716baf92f4b6396bd3ee5bd517e2 /libgfortran | |
parent | 090b4ea8eab716cb92c98dde56dc92754f29a64c (diff) | |
download | gcc-8d917a24a765d8a0eff7a44e73e2104851feb8df.zip gcc-8d917a24a765d8a0eff7a44e73e2104851feb8df.tar.gz gcc-8d917a24a765d8a0eff7a44e73e2104851feb8df.tar.bz2 |
re PR fortran/32678 ([4.2, 4.1]GFortan works incorrectly when writing with FORMAT Tx)
2007-07-08 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libgfortran/32678
* io/transfer.c (formatted_transfer_scalar): Don't allow pending_spaces
to go negative.
From-SVN: r126473
Diffstat (limited to 'libgfortran')
-rw-r--r-- | libgfortran/ChangeLog | 6 | ||||
-rw-r--r-- | libgfortran/io/transfer.c | 2 |
2 files changed, 8 insertions, 0 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index 0b9239d..7b6f3e5 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,9 @@ +2007-07-08 Jerry DeLisle <jvdelisle@gcc.gnu.org> + + PR libgfortran/32678 + * io/transfer.c (formatted_transfer_scalar): Don't allow pending_spaces + to go negative. + 2007-07-08 Thomas Koenig <tkoenig@gcc.gnu.org> PR libfortran/32217 diff --git a/libgfortran/io/transfer.c b/libgfortran/io/transfer.c index 6e3ae30..a1c774e 100644 --- a/libgfortran/io/transfer.c +++ b/libgfortran/io/transfer.c @@ -1213,6 +1213,8 @@ formatted_transfer_scalar (st_parameter_dt *dtp, bt type, void *p, int len, dtp->u.p.skips = dtp->u.p.skips + pos - bytes_used; dtp->u.p.pending_spaces = dtp->u.p.pending_spaces + pos - dtp->u.p.max_pos; + dtp->u.p.pending_spaces = dtp->u.p.pending_spaces < 0 + ? 0 : dtp->u.p.pending_spaces; if (dtp->u.p.skips == 0) break; |