mirror of
https://git.FreeBSD.org/ports.git
synced 2024-12-16 03:24:07 +00:00
5ab880074e
snprintf() and strncat(). PR: ports/66507 Submitted by: maintainer
16 lines
459 B
Plaintext
16 lines
459 B
Plaintext
--- muttlib.c.orig Fri May 7 17:30:35 2004
|
|
+++ muttlib.c Fri May 7 17:32:13 2004
|
|
@@ -656,7 +656,11 @@
|
|
|
|
void mutt_mktemp (char *s)
|
|
{
|
|
- snprintf (s, _POSIX_PATH_MAX, "%s/mutt-%s-%d-%d", NONULL (Tempdir), NONULL(Hostname), (int) getpid (), Counter++);
|
|
+ char t[7];
|
|
+ snprintf (t, 7, "-%05d", Counter++);
|
|
+ snprintf (s, _POSIX_PATH_MAX-6, "%s/mutt-%s-XXXXXXXX", NONULL(Tempdir), NONULL(Hostname));
|
|
+ mktemp (s);
|
|
+ strncat(s, t, 6);
|
|
unlink (s);
|
|
}
|
|
|