]> diplodocus.org Git - nmh/blob - sbr/m_tmpfil.c
Fix stupid accidental dependence on a bash quirk in previous
[nmh] / sbr / m_tmpfil.c
1
2 /*
3 * m_tmpfil.c -- construct a temporary file
4 *
5 * $Id$
6 *
7 * This code is Copyright (c) 2002, by the authors of nmh. See the
8 * COPYRIGHT file in the root directory of the nmh distribution for
9 * complete copyright information.
10 */
11
12 #include <h/mh.h>
13
14
15 char *
16 m_tmpfil (char *template)
17 {
18 static char tmpfil[BUFSIZ];
19
20 snprintf (tmpfil, sizeof(tmpfil), "/tmp/%sXXXXXX", template);
21 /*
22 Mkstemp work postponed until later -Doug
23 #ifdef HAVE_MKSTEMP
24 unlink(mkstemp(tmpfil));
25 #else
26 */
27 unlink(mktemp(tmpfil));
28 /*
29 #endif
30 */
31 return tmpfil;
32 }