--- sbr/m_tmpfil.c.~1~	Mon May 19 22:19:12 1997
+++ sbr/m_tmpfil.c	Tue Apr 28 22:57:48 1998
@@ -12,9 +12,15 @@
 m_tmpfil (char *template)
 {
     static char tmpfil[BUFSIZ];
+    int fd;
 
-    sprintf(tmpfil, "/tmp/%sXXXXXX", template);
-    unlink(mktemp(tmpfil));
+    snprintf(tmpfil, BUFSIZ, "/tmp/%sXXXXXX", template);
+    fd = mkstemp( tmpfil );
+    if ( fd == -1 ) {
+        return 0;
+    }
+    close( fd );
+    unlink( tmpfil );
 
     return tmpfil;
 }
