mirror of
https://github.com/pdf2htmlEX/pdf2htmlEX.git
synced 2024-07-07 18:30:34 +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
|
||||
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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user