Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
vidjil
vidjil
Commits
6dfcb930
Commit
6dfcb930
authored
Nov 04, 2014
by
Mikaël Salson
Browse files
align.cgi: Use mkstemp instead of tmpnam
parent
f70fec74
Changes
1
Hide whitespace changes
Inline
Side-by-side
algo/cgi/align.cpp
View file @
6dfcb930
...
...
@@ -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
(
f
ilename
,
"w"
);
f
=
f
d
open
(
f
d
,
"w"
);
if
(
f
==
NULL
){
cout
<<
",
\"
Error
\"
:
\"
save
\"
"
<<
filename
<<
"}"
<<
endl
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment