X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=sbr%2Fm_scratch.c;h=df635316ec95d7ac3374d55aac574560e16df292;hp=e29b10a0f6f680cd8bf053d87faeefac7a51c762;hb=0aef47ae5c03e1d9e3f225efe5ae362e7cf5ee35;hpb=0ccd1945560c715e4cc4063209bd0d68b75d5470 diff --git a/sbr/m_scratch.c b/sbr/m_scratch.c index e29b10a..df63531 100644 --- a/sbr/m_scratch.c +++ b/sbr/m_scratch.c @@ -3,6 +3,10 @@ * 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 @@ -15,15 +19,21 @@ m_scratch (char *file, char *template) 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", cp - file, file, tmpfil); + snprintf (buffer, sizeof(buffer), "%.*s%s", (int)(cp - file), file, tmpfil); unlink (buffer); return buffer;