X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=sbr%2Fm_scratch.c;fp=sbr%2Fm_scratch.c;h=0000000000000000000000000000000000000000;hb=b067ff5c465a5d243ce5a19e562085a9a1a97215;hp=a92941946a51653db90440d8045403e7a316cee8;hpb=a485ed478abbd599d8c9aab48934e7a26733ecb1;p=mmh diff --git a/sbr/m_scratch.c b/sbr/m_scratch.c deleted file mode 100644 index a929419..0000000 --- a/sbr/m_scratch.c +++ /dev/null @@ -1,40 +0,0 @@ -/* - * m_scratch.c -- construct a scratch file - * - * 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 - -/*************************************************************************** - * DO NOT USE THIS FUNCTION! IT WILL BE REMOVED IN THE FUTURE. - * THIS FUNCTION IS INSECURE. USE THE FUNCTIONS DEFINED IN m_mktemp.c. - ***************************************************************************/ -char * -m_scratch (char *file, char *template) -{ - char *cp; - static char buffer[BUFSIZ], tmpfil[BUFSIZ]; - - snprintf (tmpfil, sizeof(tmpfil), "%sXXXXXX", template); -/* - * Mkstemp work postponed until later -Doug - * #ifdef HAVE_MKSTEMP - * mkstemp (tmpfil); - * #else - */ - mktemp (tmpfil); -/* - * #endif - */ - /* nasty - this really means: if there is no '/' in the path */ - if ((cp = r1bindex (file, '/')) == file) - strncpy (buffer, tmpfil, sizeof(buffer)); - else - snprintf (buffer, sizeof(buffer), "%.*s%s", (int)(cp - file), file, tmpfil); - unlink (buffer); - - return buffer; -}