aboutsummaryrefslogtreecommitdiff
path: root/libgfortran/io/unix.c
diff options
context:
space:
mode:
authorJanne Blomqvist <jb@gcc.gnu.org>2011-04-16 20:43:03 +0300
committerJanne Blomqvist <jb@gcc.gnu.org>2011-04-16 20:43:03 +0300
commitd30fe1c5cdc98c83c1d29d6b20f88a13328faddd (patch)
treea18b46c3ac70b0e29558cbe228eaa2af23e758b9 /libgfortran/io/unix.c
parent9c575e20c33a032619b063d243f6e7320fcda878 (diff)
downloadgcc-d30fe1c5cdc98c83c1d29d6b20f88a13328faddd.zip
gcc-d30fe1c5cdc98c83c1d29d6b20f88a13328faddd.tar.gz
gcc-d30fe1c5cdc98c83c1d29d6b20f88a13328faddd.tar.bz2
Replace sprintf with snprintf
From-SVN: r172590
Diffstat (limited to 'libgfortran/io/unix.c')
-rw-r--r--libgfortran/io/unix.c6
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;