X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=pdf2swf%2Fxpdf%2Fgfile.cc;h=2350a90a9dc3d833e9003f52a1521f66cf992afb;hb=e1463a1467e39324de30c6c1199b24d9d8bc1232;hp=7bc9b2261b225badd78865a8f5c6a3bcc3b09321;hpb=38bde89116e018468a3979c37664c13c2ccc81b0;p=swftools.git diff --git a/pdf2swf/xpdf/gfile.cc b/pdf2swf/xpdf/gfile.cc index 7bc9b22..2350a90 100644 --- a/pdf2swf/xpdf/gfile.cc +++ b/pdf2swf/xpdf/gfile.cc @@ -442,10 +442,18 @@ time_t getModTime(char *fileName) { #endif } static char tmpbuf[128]; -static char* mktmpname(char*ptr) { +char* mktmpname(char*ptr) { // used to be mktemp. This does remove the warnings, but // It's not exactly an improvement. +#ifdef HAVE_LRAND48 sprintf(tmpbuf, "/tmp/%08x%08x",lrand48(),lrand48()); +#else +# ifdef HAVE_RAND + sprintf(tmpbuf, "/tmp/%08x%08x",rand(),rand()); +# else + sprintf(tmpbuf, "/tmp/%08x%08x",time(0),(unsigned int)tmpbuf); +# endif +#endif return tmpbuf; } GBool openTempFile(GString **name, FILE **f, char *mode, char *ext) {