Commit 6dfcb930 authored by Mikael Salson's avatar Mikael Salson

align.cgi: Use mkstemp instead of tmpnam

parent f70fec74
......@@ -18,8 +18,13 @@ int main(int argc, char* argv[])
ostringstream ost;
ostream * p;
p=&ost;
char filename[L_tmpnam];
tmpnam(filename);
char filename[] = "VidjilAlignXXXXXX";
int fd = mkstemp(filename);
if (fd == -1) {
perror("Creation of temporary file");
exit(1);
}
bool cgi_mode;
......@@ -48,7 +53,7 @@ int main(int argc, char* argv[])
char temp[1024];
FILE *f;
f = fopen(filename,"w");
f = fdopen(fd,"w");
if(f == NULL){
cout<<",\"Error\": \"save\""<<filename<<"}"<<endl;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment