Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
ioping
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
ioping
Commits
7f01ea43
Commit
7f01ea43
authored
Dec 30, 2013
by
Konstantin Khlebnikov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ioping: use snprintf instead of sprintf
Signed-off-by:
Konstantin Khlebnikov
<
koct9i@gmail.com
>
parent
188a929c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
ioping.c
ioping.c
+6
-4
No files found.
ioping.c
View file @
7f01ea43
...
@@ -738,13 +738,14 @@ static void aio_setup(void)
...
@@ -738,13 +738,14 @@ static void aio_setup(void)
int
create_temp
(
char
*
path
,
char
*
template
)
int
create_temp
(
char
*
path
,
char
*
template
)
{
{
char
*
temp
=
malloc
(
strlen
(
path
)
+
strlen
(
template
)
+
2
);
int
length
=
strlen
(
path
)
+
strlen
(
template
)
+
2
;
char
*
temp
=
malloc
(
length
);
HANDLE
h
;
HANDLE
h
;
DWORD
attr
;
DWORD
attr
;
if
(
!
temp
)
if
(
!
temp
)
err
(
2
,
NULL
);
err
(
2
,
NULL
);
s
printf
(
temp
,
"%s
\\
%s"
,
path
,
template
);
s
nprintf
(
temp
,
length
,
"%s
\\
%s"
,
path
,
template
);
mktemp
(
temp
);
mktemp
(
temp
);
attr
=
FILE_ATTRIBUTE_HIDDEN
|
FILE_FLAG_DELETE_ON_CLOSE
;
attr
=
FILE_ATTRIBUTE_HIDDEN
|
FILE_FLAG_DELETE_ON_CLOSE
;
...
@@ -787,12 +788,13 @@ void set_signal(void)
...
@@ -787,12 +788,13 @@ void set_signal(void)
int
create_temp
(
char
*
path
,
char
*
template
)
int
create_temp
(
char
*
path
,
char
*
template
)
{
{
char
*
temp
=
malloc
(
strlen
(
path
)
+
strlen
(
template
)
+
2
);
int
length
=
strlen
(
path
)
+
strlen
(
template
)
+
2
;
char
*
temp
=
malloc
(
length
);
int
fd
;
int
fd
;
if
(
!
temp
)
if
(
!
temp
)
err
(
2
,
NULL
);
err
(
2
,
NULL
);
s
printf
(
temp
,
"%s/%s"
,
path
,
template
);
s
nprintf
(
temp
,
length
,
"%s/%s"
,
path
,
template
);
fd
=
mkstemp
(
temp
);
fd
=
mkstemp
(
temp
);
if
(
fd
<
0
)
if
(
fd
<
0
)
...
...
Write
Preview
Markdown
is supported
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