aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerry DeLisle <jvdelisle@verizon.net>2005-07-17 20:28:14 +0000
committerJerry DeLisle <jvdelisle@gcc.gnu.org>2005-07-17 20:28:14 +0000
commit2c01a7204f0a9f488e79f90b4eff288b03f88439 (patch)
tree657e52b4b7717315c308f9e9aba4fdb3676ec903
parent3b1355f3bc89b1df7d6d93a1e24ce1791ada787d (diff)
downloadgcc-2c01a7204f0a9f488e79f90b4eff288b03f88439.zip
gcc-2c01a7204f0a9f488e79f90b4eff288b03f88439.tar.gz
gcc-2c01a7204f0a9f488e79f90b4eff288b03f88439.tar.bz2
write.c (write_float): Fix field width checks for printing 'Infinity' or 'Inf'.
2005-07-14 Jerry DeLisle <jvdelisle@verizon.net> * io/write.c (write_float): Fix field width checks for printing 'Infinity' or 'Inf'. (output_float): Fix typo in comment. From-SVN: r102115
-rw-r--r--libgfortran/ChangeLog6
-rw-r--r--libgfortran/io/write.c6
2 files changed, 9 insertions, 3 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index 48788f1..f4f0616 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,9 @@
+2005-07-14 Jerry DeLisle <jvdelisle@verizon.net>
+
+ * io/write.c (write_float): Fix field width checks for
+ printing 'Infinity' or 'Inf'.
+ (output_float): Fix typo in comment.
+
2005-07-12 Paul Thomas <pault@gcc.gnu.org>
PR libfortran/16435
diff --git a/libgfortran/io/write.c b/libgfortran/io/write.c
index c7abf2b..54bf480 100644
--- a/libgfortran/io/write.c
+++ b/libgfortran/io/write.c
@@ -649,7 +649,7 @@ output_float (fnode *f, GFC_REAL_LARGEST value)
else
leadzero = 0;
- /* Padd to full field width. */
+ /* Pad to full field width. */
if ( ( nblanks > 0 ) && !no_leading_blank )
@@ -788,11 +788,11 @@ write_float (fnode *f, const char *source, int len)
else
fin = '+';
- if (nb > 7)
+ if (nb > 8)
memcpy(p + nb - 8, "Infinity", 8);
else
memcpy(p + nb - 3, "Inf", 3);
- if (nb < 8 && nb > 3)
+ if (nb < 9 && nb > 3)
p[nb - 4] = fin;
else if (nb > 8)
p[nb - 9] = fin;