spellutils (0.7-5) lib.c

Summary

 lib.c |   10 ++++++++++
 1 file changed, 10 insertions(+)

    
download this patch

Patch contents

--- spellutils-0.7.orig/lib.c
+++ spellutils-0.7/lib.c
@@ -121,10 +121,20 @@
 
 char *nb_tmpnam ()
 {
+#ifdef HAVE_MKSTEMP
+  char *name = nb_malloc (_POSIX_PATH_MAX);
+  strcpy (name, "/tmp/newsbodyXXXXXX");
+  if (mkstemp(name) == -1) {
+    nb_error (E_ERRNO, _("making temporary filename"));
+    return name;
+  }
+#else
   char *name = tmpnam (nb_malloc (_POSIX_PATH_MAX));
 
   if (!name)
     nb_error (E_ERRNO, _("making temporary filename"));
+#endif
+
   return name;
 }