$NetBSD: patch-ab,v 1.1 2005/07/16 15:40:56 wiz Exp $

--- src/stats.c.orig	Thu Apr 29 10:06:10 2004
+++ src/stats.c
@@ -185,6 +185,8 @@ stats_dump (void)
         FILE          *fp;
         mail_t        *mail;
         struct estats  stats;
+	int            fd;
+	char           fn[25] = "/tmp/elmostats.XXXXXXXXX";

         if (wrapbox_marray == NULL)
                 return;
@@ -200,9 +202,12 @@ stats_dump (void)
                         process_mail (& stats, mail);
         }

-        fp = fopen ("/tmp/elmostats", "w");
-        if (fp == NULL){
-                error_ (errno, _("couldn't open %s"), "/tmp/elmostats");
+	fp = NULL;
+	fd = mkstemp(fn);
+        if (fd != -1 )
+		fp = fdopen (fd, "w");
+        if (fp == NULL) {
+                error_ (errno, _("couldn't open %s"), fn);
                 destroy_stats (& stats);
                 return;
         }
