use mktmpname(), not tmpnam().
authorkramm <kramm>
Tue, 28 May 2002 11:02:34 +0000 (11:02 +0000)
committerkramm <kramm>
Tue, 28 May 2002 11:02:34 +0000 (11:02 +0000)
pdf2swf/xpdf/gfile.cc

index 1848908..9c7d789 100644 (file)
@@ -489,7 +489,7 @@ GBool openTempFile(GString **name, FILE **f, char *mode, char *ext) {
   // with this file name after the tmpnam call and before the fopen
   // call.  I will happily accept fixes to this function for non-Unix
   // OSs.
   // with this file name after the tmpnam call and before the fopen
   // call.  I will happily accept fixes to this function for non-Unix
   // OSs.
-  if (!(s = tmpnam(NULL))) {
+  if (!(s = mktmpname(NULL))) { //was: tmpnam
     return gFalse;
   }
   *name = new GString(s);
     return gFalse;
   }
   *name = new GString(s);
@@ -516,7 +516,7 @@ GBool openTempFile(GString **name, FILE **f, char *mode, char *ext) {
     (*name)->append("/XXXXXX")->append(ext);
     fd = mkstemps((*name)->getCString(), strlen(ext));
 #else
     (*name)->append("/XXXXXX")->append(ext);
     fd = mkstemps((*name)->getCString(), strlen(ext));
 #else
-    if (!(s = tmpnam(NULL))) {
+    if (!(s = mktmpname(NULL))) { //was: tmpnam
       return gFalse;
     }
     *name = new GString(s);
       return gFalse;
     }
     *name = new GString(s);
@@ -533,7 +533,7 @@ GBool openTempFile(GString **name, FILE **f, char *mode, char *ext) {
     (*name)->append("/XXXXXX");
     fd = mkstemp((*name)->getCString());
 #else // HAVE_MKSTEMP
     (*name)->append("/XXXXXX");
     fd = mkstemp((*name)->getCString());
 #else // HAVE_MKSTEMP
-    if (!(s = tmpnam(NULL))) {
+    if (!(s = mktmpname(NULL))) { //was: tmpnam
       return gFalse;
     }
     *name = new GString(s);
       return gFalse;
     }
     *name = new GString(s);