From d30fe1c5cdc98c83c1d29d6b20f88a13328faddd Mon Sep 17 00:00:00 2001 From: Janne Blomqvist Date: Sat, 16 Apr 2011 20:43:03 +0300 Subject: Replace sprintf with snprintf From-SVN: r172590 --- libgfortran/io/unix.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'libgfortran/io/unix.c') 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; -- cgit v1.1