X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=sbr%2Fm_scratch.c;h=a92941946a51653db90440d8045403e7a316cee8;hp=3c63d092d221510bd43c352158abcd959c4ee22e;hb=a485ed478abbd599d8c9aab48934e7a26733ecb1;hpb=f480c03187724e54e5391ee61b810827da319a6c diff --git a/sbr/m_scratch.c b/sbr/m_scratch.c index 3c63d09..a929419 100644 --- a/sbr/m_scratch.c +++ b/sbr/m_scratch.c @@ -1,4 +1,3 @@ - /* * m_scratch.c -- construct a scratch file * @@ -16,26 +15,26 @@ char * m_scratch (char *file, char *template) { - char *cp; - static char buffer[BUFSIZ], tmpfil[BUFSIZ]; + char *cp; + static char buffer[BUFSIZ], tmpfil[BUFSIZ]; - snprintf (tmpfil, sizeof(tmpfil), "%sXXXXXX", template); + snprintf (tmpfil, sizeof(tmpfil), "%sXXXXXX", template); /* - Mkstemp work postponed until later -Doug -#ifdef HAVE_MKSTEMP - mkstemp (tmpfil); -#else -*/ - mktemp (tmpfil); + * 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); + * #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; + return buffer; }