https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83168
Thomas Koenig <tkoenig at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tkoenig at gcc dot gnu.org --- Comment #5 from Thomas Koenig <tkoenig at gcc dot gnu.org> --- Hi Jerry, > diff --git a/libgfortran/io/write.c b/libgfortran/io/write.c > index c9aad150..d26358c0 100644 > --- a/libgfortran/io/write.c > +++ b/libgfortran/io/write.c > @@ -1552,7 +1552,7 @@ select_string (st_parameter_dt *dtp, const fnode *f, > char *buf, size_t *size, > int kind) > { > char *result; > - *size = size_from_kind (dtp, f, kind) + f->u.real.d; > + *size = size_from_kind (dtp, f, kind) + f->u.real.d + 1; > if (*size > BUF_STACK_SZ) > result = xmalloc (*size); > else Pre-approved (if you don't consider it obvious in the first place :-)