summaryrefslogtreecommitdiffstats
path: root/patches/tmpfilename.patch
blob: 287b31e9f8f54ddc700d4e1c4734561a95ea60a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
--- ./Source/util.cpp.orig	2025-06-26 08:43:48.769850406 +0200
+++ ./Source/util.cpp	2025-06-26 08:45:50.137949572 +0200
@@ -814,12 +814,14 @@
 #ifdef _WIN32
   TCHAR buftmpdir[MAX_PATH], buf[MAX_PATH];
   DWORD cch = GetTempPath(COUNTOF(buftmpdir), buftmpdir);
-  if (cch && cch < COUNTOF(buftmpdir) && GetTempFileName(buftmpdir, _T("nst"), 0, buf))
+  if (cch && cch < COUNTOF(buftmpdir) && GetTempFileName(buftmpdir, _T("nst"), 0, buf)) {
+    lstrcat(buf, _T(".bin"));
     tfpath = _tcsdup(buf);
+  }
 #else //! _WIN32
-  char narrowpath[] = ("/tmp/makensisXXXXXX");
+  char narrowpath[] = ("/tmp/makensisXXXXXX.bin");
   const mode_t org_umask = umask(0077);
-  int fd = mkstemp(narrowpath);
+  int fd = mkstemps(narrowpath,4);
   umask(org_umask);
   if (fd != -1)
   {