Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
MIGraphX
Commits
64199a0f
Commit
64199a0f
authored
Nov 27, 2023
by
Artur Wojcik
Browse files
change std::copy() to std::strncpy() for cmdline
parent
e314f8fb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
src/process.cpp
src/process.cpp
+4
-3
No files found.
src/process.cpp
View file @
64199a0f
...
@@ -32,6 +32,7 @@
...
@@ -32,6 +32,7 @@
// cppcheck-suppress definePrefix
// cppcheck-suppress definePrefix
#define WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#include <Windows.h>
#include <cstring>
#else
#else
#include <unistd.h>
#include <unistd.h>
#endif
#endif
...
@@ -217,11 +218,11 @@ int exec(const std::pair<std::string, std::string>& command, F f)
...
@@ -217,11 +218,11 @@ int exec(const std::pair<std::string, std::string>& command, F f)
info
.
hStdInput
=
input
.
get_read_handle
();
info
.
hStdInput
=
input
.
get_read_handle
();
info
.
dwFlags
|=
STARTF_USESTDHANDLES
;
info
.
dwFlags
|=
STARTF_USESTDHANDLES
;
TCHAR
cmdline
[
MAX_PATH
];
std
::
copy
(
std
::
begin
(
cmd
),
std
::
end
(
cmd
),
std
::
begin
(
cmdline
));
ZeroMemory
(
&
process_info
,
sizeof
(
process_info
));
ZeroMemory
(
&
process_info
,
sizeof
(
process_info
));
TCHAR
cmdline
[
MAX_PATH
];
std
::
strncpy
(
cmd
.
c_str
(),
cmdline
,
MAX_PATH
);
if
(
CreateProcess
(
nullptr
,
if
(
CreateProcess
(
nullptr
,
cmdline
,
cmdline
,
nullptr
,
nullptr
,
...
...
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