From 93ab3a3d79f363b09a7ef21fc20a2ecbf6f81308 Mon Sep 17 00:00:00 2001 From: Jerry DeLisle Date: Tue, 30 Jun 2009 00:46:35 +0000 Subject: [PATCH] re PR fortran/40576 (Endless loop in internal write) 2009-06-29 Jerry DeLisle PR libfortran/40576 * io/transfer.c (sset): Adjust exit condition for loop. From-SVN: r149075 --- libgfortran/ChangeLog | 5 +++++ libgfortran/io/transfer.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index 1a6aa8044cf..dda90a6c09b 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,8 @@ +2009-06-29 Jerry DeLisle + + PR libfortran/40576 + * io/transfer.c (sset): Adjust exit condition for loop. + 2009-06-22 Jerry DeLisle PR libfortran/40508 diff --git a/libgfortran/io/transfer.c b/libgfortran/io/transfer.c index 585ae43acbf..4ad1cf035d0 100644 --- a/libgfortran/io/transfer.c +++ b/libgfortran/io/transfer.c @@ -2867,7 +2867,7 @@ sset (stream * s, int c, ssize_t nbyte) { trans = (bytes_left < WRITE_CHUNK) ? bytes_left : WRITE_CHUNK; trans = swrite (s, p, trans); - if (trans < 0) + if (trans <= 0) return trans; bytes_left -= trans; }