diff options
Diffstat (limited to 'libgfortran/io/unix.c')
-rw-r--r-- | libgfortran/io/unix.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libgfortran/io/unix.c b/libgfortran/io/unix.c index d14d2b4e..4295071 100644 --- a/libgfortran/io/unix.c +++ b/libgfortran/io/unix.c @@ -1068,7 +1068,8 @@ tempfile (st_parameter_open *opp) template = get_mem (tempdirlen + 23); #ifdef HAVE_MKSTEMP - sprintf (template, "%s%sgfortrantmpXXXXXX", tempdir, slash); + snprintf (template, tempdirlen + 23, "%s%sgfortrantmpXXXXXX", + tempdir, slash); fd = mkstemp (template); @@ -1078,7 +1079,8 @@ tempfile (st_parameter_open *opp) slashlen = strlen (slash); do { - sprintf (template, "%s%sgfortrantmpaaaXXXXXX", tempdir, slash); + snprintf (template, tempdirlen + 23, "%s%sgfortrantmpaaaXXXXXX", + tempdir, slash); if (count > 0) { int c = count; |