X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=pdf2swf%2Fxpdf%2Fgfile.cc;fp=pdf2swf%2Fxpdf%2Fgfile.cc;h=18489086de6e0f630b89acda2e8a5879db440425;hb=2eb549d27d295e3023f06ce027c0e673430c31ed;hp=d6d2363e5134249d106ae815b8ebbaee477e30ac;hpb=195800383723343bb7f1fbc1f327bedd2aee0253;p=swftools.git diff --git a/pdf2swf/xpdf/gfile.cc b/pdf2swf/xpdf/gfile.cc index d6d2363..1848908 100644 --- a/pdf2swf/xpdf/gfile.cc +++ b/pdf2swf/xpdf/gfile.cc @@ -9,6 +9,7 @@ //======================================================================== #include +#include "../../config.h" #ifdef WIN32 extern "C" { @@ -442,6 +443,23 @@ time_t getModTime(char *fileName) { return statBuf.st_mtime; #endif } + +static char tmpbuf[128]; + +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) { #if defined(WIN32)