1
0
mirror of https://github.com/pdf2htmlEX/pdf2htmlEX.git synced 2024-07-05 01:28:39 +00:00

use mkdtemp instead of tmpnam

This commit is contained in:
Lu Wang 2012-09-10 02:22:49 +08:00
parent ec6ce4d888
commit 02a735aa9f

View File

@ -122,7 +122,15 @@ int main(int argc, char **argv)
}
//prepare the directories
param.tmp_dir = tmpnam(nullptr);
char buf[] = "/tmp/pdf2htmlEX-XXXXXX";
auto p = mkdtemp(buf);
if(p == nullptr)
{
cerr << "Cannot create temp directory" << endl;
return -1;
}
param.tmp_dir = buf;
if(param.debug)
cerr << "temporary dir: " << (param.tmp_dir) << endl;