This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/32554] [4.3 regression] Bug in P formatting
- From: "jvdelisle at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 Jun 2007 00:20:29 -0000
- Subject: [Bug fortran/32554] [4.3 regression] Bug in P formatting
- References: <bug-32554-6318@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from jvdelisle at gcc dot gnu dot org 2007-06-30 00:20 -------
This appears to fix it but I am not sure yet. More testing.
Index: write.c
===================================================================
--- write.c (revision 126131)
+++ write.c (working copy)
@@ -546,7 +546,7 @@ output_float (st_parameter_dt *dtp, cons
* digits; if the value is zero, the exponent is 00.
*/
#ifdef HAVE_SNPRINTF
- snprintf (buffer, sizeof (buffer), "%+-#" STR(MIN_FIELD_WIDTH) ".*"
+ snprintf (buffer, sizeof (buffer)+1, "%+-#" STR(MIN_FIELD_WIDTH) ".*"
GFC_REAL_LARGEST_FORMAT "e", ndigits - 1, value);
#else
sprintf (buffer, "%+-#" STR(MIN_FIELD_WIDTH) ".*"
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32554