- snprintf (tmpfil, sizeof(tmpfil), "%sXXXXXX", template);
-#ifdef HAVE_MKSTEMP
- mkstemp (tmpfil);
-#else
- mktemp (tmpfil);
-#endif
- if ((cp = r1bindex (file, '/')) == file)
- strncpy (buffer, tmpfil, sizeof(buffer));
- else
- snprintf (buffer, sizeof(buffer), "%.*s%s", cp - file, file, tmpfil);
- unlink (buffer);
+ 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);