This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[gfortran,commited] Fix for PR 29713
- From: FX Coudert <fxcoudert at gmail dot com>
- To: gfortran List <fortran at gcc dot gnu dot org>, gcc-patches patches <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 4 Nov 2006 22:05:30 +0100
- Subject: [gfortran,commited] Fix for PR 29713
Hi all,
I commited the following fix for PR 29713, a stupid bug arising from
my NULL-termination patch, on mainline. I'll be waiting for
objections and to see if something happens before backporting it to
4.2 and 4.1.
Index: gcc/fortran/expr.c
===================================================================
--- gcc/fortran/expr.c (revision 118455)
+++ gcc/fortran/expr.c (working copy)
@@ -1436,7 +1436,7 @@
gfc_extract_int (p->ref->u.ss.start, &start);
start--; /* Convert from one-based to zero-based. */
gfc_extract_int (p->ref->u.ss.end, &end);
- s = gfc_getmem (end - start + 1);
+ s = gfc_getmem (end - start + 2);
memcpy (s, p->value.character.string + start, end - start);
s[end-start+1] = '\0'; /* TODO: C-style string for
debugging. */
gfc_free (p->value.character.string);