View | Details | Raw Unified | Return to bug 66508
Collapse All | Expand All

(-)./files/patch-mktemp (-2 / +2 lines)
Lines 7-15 Link Here
7
-  snprintf (s, _POSIX_PATH_MAX, "%s/mutt-%s-%d-%d", NONULL (Tempdir), NONULL(Hostname), (int) getpid (), Counter++);
7
-  snprintf (s, _POSIX_PATH_MAX, "%s/mutt-%s-%d-%d", NONULL (Tempdir), NONULL(Hostname), (int) getpid (), Counter++);
8
+  char t[7];
8
+  char t[7];
9
+  snprintf (t, 7, "-%05d", Counter++);
9
+  snprintf (t, 7, "-%05d", Counter++);
10
+  snprintf (s, _POSIX_PATH_MAX-7, "%s/mutt-%s-XXXXXXXX", NONULL(Tempdir), NONULL(Hostname));
10
+  snprintf (s, _POSIX_PATH_MAX-6, "%s/mutt-%s-XXXXXXXX", NONULL(Tempdir), NONULL(Hostname));
11
+  mktemp (s);
11
+  mktemp (s);
12
+  strncat(s, t, _POSIX_PATH_MAX);
12
+  strncat(s, t, 6);
13
   dprint (1, (debugfile, "%s:%d: mutt_mktemp returns \"%s\".\n", src, line, s));
13
   dprint (1, (debugfile, "%s:%d: mutt_mktemp returns \"%s\".\n", src, line, s));
14
   unlink (s);
14
   unlink (s);
15
 }
15
 }

Return to bug 66508