Re: Patch to fix an undefined behavior in fortran/decl.c

2017-12-01 Thread Thomas Koenig
HI Quing, this is a very straightforward fix for an undefined behavior in fortran/decl.c: > - sprintf (name, "%s_%d", name, kind_value); > + sprintf (name + strlen (name), "_%d", kind_value); OK for trunk. Thanks for the patch! Regards Thomas

Patch to fix an undefined behavior in fortran/decl.c

2017-12-01 Thread Qing Zhao
Hi, this is a very straightforward fix for an undefined behavior in fortran/decl.c: In the man page of sprintf, it's clearly state: === NOTES Some programs imprudently rely on code such as the following sprintf(buf, "%s some further text", buf); to append text to buf. H