Message ID | 4f4c9fe9-f1b0-c707-71dc-4218d7b9ec5f@charter.net |
---|---|
State | New |
Headers | show |
Series | [committed] PR83811 fortran 'e' format broken for single digit exponents | expand |
On 01/14/2018 09:42 AM, Jerry DeLisle wrote: > Hello all, > > I committed the following as trivial. > > Regression tested on x86_64-pc-linux-gnu. > > This is a regression on 7 so I will backport. > > Regards, > > Jerry > > 2018-01-18 Jerry DeLisle <jvdelisle@gcc.gnu.org> > > PR libgfortran/83811 > * write.c (select_buffer): Adjust buffer size up by 1. > Committed to gcc7 after regression testing and I fixed the dates I had in the ChangeLogs. Cheers, Jerry
diff --git a/libgfortran/io/write.c b/libgfortran/io/write.c index 8021a1e9c4b..28ea852867b 100644 --- a/libgfortran/io/write.c +++ b/libgfortran/io/write.c @@ -1519,8 +1519,9 @@ select_buffer (st_parameter_dt *dtp, const fnode *f, int precision, { char *result; - /* The buffer needs at least one more byte to allow room for normalizing. */ - *size = size_from_kind (dtp, f, kind) + precision + 1; + /* The buffer needs at least one more byte to allow room for + normalizing and 1 to hold null terminator. */ + *size = size_from_kind (dtp, f, kind) + precision + 1 + 1; if (*size > BUF_STACK_SZ)