aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/expr.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fortran/expr.c')
-rw-r--r--gcc/fortran/expr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c
index 1f51fd0..d2da0d8 100644
--- a/gcc/fortran/expr.c
+++ b/gcc/fortran/expr.c
@@ -1438,7 +1438,7 @@ gfc_simplify_expr (gfc_expr * p, int type)
gfc_extract_int (p->ref->u.ss.end, &end);
s = gfc_getmem (end - start + 1);
memcpy (s, p->value.character.string + start, end - start);
- s[end] = '\0'; /* TODO: C-style string for debugging. */
+ s[end-start+1] = '\0'; /* TODO: C-style string for debugging. */
gfc_free (p->value.character.string);
p->value.character.string = s;
p->value.character.length = end - start;