From: Florian Krohm Date: Sat, 9 Aug 2014 21:45:56 +0000 (+0000) Subject: Use mkstemp_format in VG_(mkstemp). That way nothing breaks should X-Git-Tag: svn/VALGRIND_3_10_0~207 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0c5d59ca77a551a32b86a5e6f30961c4b4813458;p=thirdparty%2Fvalgrind.git Use mkstemp_format in VG_(mkstemp). That way nothing breaks should the format change. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14252 --- diff --git a/coregrind/m_libcfile.c b/coregrind/m_libcfile.c index d42128e1a0..ccac5bb531 100644 --- a/coregrind/m_libcfile.c +++ b/coregrind/m_libcfile.c @@ -709,7 +709,7 @@ const HChar *VG_(tmpdir)(void) return tmpdir; } -static const HChar *mkstemp_format = "%s/valgrind_%s_%08x"; +static const HChar mkstemp_format[] = "%s/valgrind_%s_%08x"; SizeT VG_(mkstemp_fullname_bufsz) ( SizeT part_of_name_len ) { @@ -742,7 +742,7 @@ Int VG_(mkstemp) ( const HChar* part_of_name, /*OUT*/HChar* fullname ) while (True) { if (tries++ > 10) return -1; - VG_(sprintf)( buf, "%s/valgrind_%s_%08x", + VG_(sprintf)( buf, mkstemp_format, tmpdir, part_of_name, VG_(random)( &seed )); if (0) VG_(printf)("VG_(mkstemp): trying: %s\n", buf);