diff --git a/src/tl/tl/tlFileUtils.cc b/src/tl/tl/tlFileUtils.cc index b25a297f6..28c3741a3 100644 --- a/src/tl/tl/tlFileUtils.cc +++ b/src/tl/tl/tlFileUtils.cc @@ -1038,7 +1038,7 @@ tmpfile (const std::string &domain) char *tmpstr = strdup (templ.c_str ()); #if defined(_WIN32) - if (_mktemp_s (tmpstr, templ.size ()) != 0) { + if (_mktemp_s (tmpstr, templ.size () + 1) != 0) { free (tmpstr); throw tl::Exception (tl::to_string (tr ("Unable to create temporary folder name in %s")), tmp); } @@ -1092,7 +1092,7 @@ tmpdir (const std::string &domain) char *tmpstr = strdup (templ.c_str ()); #if defined(_WIN32) - if (_mktemp_s (tmpstr, templ.size ()) != 0) { + if (_mktemp_s (tmpstr, templ.size () + 1) != 0) { free (tmpstr); throw tl::Exception (tl::to_string (tr ("Unable to create temporary folder name in %s")), tmp); }