]> diplodocus.org Git - nmh/blob - sbr/m_tmpfil.c
Just reworded the bit about '%s' being safe not to quote (it's only safe not to
[nmh] / sbr / m_tmpfil.c
1
2 /*
3 * m_tmpfil.c -- construct a temporary file
4 *
5 * $Id$
6 */
7
8 #include <h/mh.h>
9
10
11 char *
12 m_tmpfil (char *template)
13 {
14 static char tmpfil[BUFSIZ];
15
16 snprintf (tmpfil, sizeof(tmpfil), "/tmp/%sXXXXXX", template);
17 /*
18 Mkstemp work postponed until later -Doug
19 #ifdef HAVE_MKSTEMP
20 unlink(mkstemp(tmpfil));
21 #else
22 */
23 unlink(mktemp(tmpfil));
24 /*
25 #endif
26 */
27 return tmpfil;
28 }