Commit 6dfcb930 authored by Mikaël Salson's avatar Mikaël Salson
Browse files

align.cgi: Use mkstemp instead of tmpnam

parent f70fec74
......@@ -18,8 +18,13 @@ int main(int argc, char* argv[])
ostringstream ost;
ostream * p;
char filename[L_tmpnam];
char filename[] = "VidjilAlignXXXXXX";
int fd = mkstemp(filename);
if (fd == -1) {
perror("Creation of temporary file");
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;
Supports Markdown
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