/*
 * m_tmpfil.c -- construct a temporary file
 *
 * $Id: m_tmpfil.c,v 1.4 2002/07/02 22:09:14 kenh Exp $
 *
 * This code is Copyright (c) 2002, by the authors of nmh.  See the
 * COPYRIGHT file in the root directory of the nmh distribution for
 * complete copyright information.
 */

#include <h/mh.h>


char *
m_tmpfil (char *template)
{
    static char tmpfil[BUFSIZ];

    snprintf (tmpfil, sizeof(tmpfil), "/tmp/%sXXXXXX", template);
/*
  Mkstemp work postponed until later -Doug
#ifdef HAVE_MKSTEMP
    unlink(mkstemp(tmpfil));
#else
*/
    unlink(mktemp(tmpfil));
/*
#endif
*/
    return tmpfil;
}


syntax highlighted by Code2HTML, v. 0.9.1