X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=sbr%2Fm_scratch.c;h=353da5624d56daff00301dc179dbe8d9e0cbe794;hb=3bf07d227725f798f654ac09f015f35d27ab83cb;hp=d71257696f378f20c05021c3ba6ad4cc16eba690;hpb=045b9601403a216c400642229f2b291f85f88f7d;p=mmh diff --git a/sbr/m_scratch.c b/sbr/m_scratch.c index d712576..353da56 100644 --- a/sbr/m_scratch.c +++ b/sbr/m_scratch.c @@ -3,11 +3,18 @@ * m_scratch.c -- construct a scratch file * * $Id$ + * + * 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) { @@ -25,11 +32,11 @@ m_scratch (char *file, char *template) /* #endif */ -/* nasty - this really means: if there is no '/' in the path */ + /* 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", cp - file, file, tmpfil); + snprintf (buffer, sizeof(buffer), "%.*s%s", (int)(cp - file), file, tmpfil); unlink (buffer); return buffer;