Rearranged whitespace (and comments) in all the code!
[mmh] / sbr / m_tmpfil.c
1 /*
2  * m_tmpfil.c -- construct a temporary file
3  *
4  * This code is Copyright (c) 2002, by the authors of nmh.  See the
5  * COPYRIGHT file in the root directory of the nmh distribution for
6  * complete copyright information.
7  */
8
9 #include <h/mh.h>
10
11 /***************************************************************************
12  * DO NOT USE THIS FUNCTION!  IT WILL BE REMOVED IN THE FUTURE.
13  * THIS FUNCTION IS INSECURE.  USE THE FUNCTIONS DEFINED IN m_mktemp.c.
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 }