mirror of
https://github.com/pdf2htmlEX/pdf2htmlEX.git
synced 2024-10-05 19:41:40 +00:00
use mkdtemp instead of tmpnam
This commit is contained in:
parent
ec6ce4d888
commit
02a735aa9f
@ -122,7 +122,15 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//prepare the directories
|
//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)
|
if(param.debug)
|
||||||
cerr << "temporary dir: " << (param.tmp_dir) << endl;
|
cerr << "temporary dir: " << (param.tmp_dir) << endl;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user