summaryrefslogtreecommitdiff
path: root/libgfortran
diff options
context:
space:
mode:
authorjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>2007-07-09 00:15:15 +0000
committerjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>2007-07-09 00:15:15 +0000
commit1b27c4af888efcce9ced3fa2e9d09f14a2e48aaf (patch)
tree4a9c76ca6c95716baf92f4b6396bd3ee5bd517e2 /libgfortran
parente3619285aa84b009b9209d2f9a7260b5a457cc87 (diff)
downloadgcc-1b27c4af888efcce9ced3fa2e9d09f14a2e48aaf.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@126473 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran')
-rw-r--r--libgfortran/ChangeLog6
-rw-r--r--libgfortran/io/transfer.c2
2 files changed, 8 insertions, 0 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index 0b9239d1e0a..7b6f3e567cd 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 6e3ae30b140..a1c774e1dfd 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;