summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2022-09-23 18:28:51 +0200
committerGitHub <noreply@github.com>2022-09-23 18:28:51 +0200
commit697cb84ee1a1ebc3aed0e3b3437f246a7c34f3fb (patch)
tree5b6edd9893cf99ef0120d37a8676b6f74f2e65d9
parenta16ac15dd106967992baef21a91f73f002b2cb79 (diff)
parenteb1fccda5feb81606a021382bb8fe4d40c85b087 (diff)
downloadATCD-697cb84ee1a1ebc3aed0e3b3437f246a7c34f3fb.tar.gz
Merge pull request #1943 from lukem/format-security-fixup
Fix -Wformat-security issues in examples
-rw-r--r--ACE/examples/OS/Process/imore.cpp4
-rw-r--r--ACE/examples/OS/Process/process.cpp6
2 files changed, 5 insertions, 5 deletions
diff --git a/ACE/examples/OS/Process/imore.cpp b/ACE/examples/OS/Process/imore.cpp
index 46233c6f975..bee6f5cd3f6 100644
--- a/ACE/examples/OS/Process/imore.cpp
+++ b/ACE/examples/OS/Process/imore.cpp
@@ -240,7 +240,7 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[])
ACE_ERROR_RETURN ((LM_ERROR, "Error, bailing out!\n"), -1);
}
- options.command_line (executable);
+ options.command_line (ACE_TEXT("%") ACE_TEXT_PRIs, executable);
if (new_process.spawn (options) == -1)
{
int const error_number = ACE_OS::last_error ();
@@ -260,7 +260,7 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[])
// if your child process don't need to interact with the terminal,
// we can use the exact code for Unixes on NT.
ACE_Process_Options options;
- options.command_line (executable);
+ options.command_line (ACE_TEXT("%") ACE_TEXT_PRIs, executable);
options.set_handles (infile);
if (new_process.spawn (options) == -1)
{
diff --git a/ACE/examples/OS/Process/process.cpp b/ACE/examples/OS/Process/process.cpp
index 87e8e53f29e..f0d31e5babd 100644
--- a/ACE/examples/OS/Process/process.cpp
+++ b/ACE/examples/OS/Process/process.cpp
@@ -124,7 +124,7 @@ test_more ()
ACE_Process new_process;
ACE_Process_Options options;
- options.command_line (executable);
+ options.command_line (ACE_TEXT ("%") ACE_TEXT_PRIs, executable);
options.set_handles (infile);
if (new_process.spawn (options) == -1)
@@ -153,7 +153,7 @@ static void
test_date ()
{
ACE_Process_Options options;
- options.command_line (DATE_PATH);
+ options.command_line (ACE_TEXT ("%") ACE_TEXT_PRIs, DATE_PATH);
// Try to create a new process running date.
ACE_Process new_process;
@@ -457,7 +457,7 @@ test_setenv (const ACE_TCHAR *argv0)
options.setenv (ACE_TEXT ("ACE_PROCESS_TEST= here's a large number %u"),
0 - 1);
options.setenv (ACE_TEXT ("ACE_PROCESS_TEST2"), ACE_TEXT ("ophilli"));
- options.command_line (ACE_TEXT ("%") ACE_TEXT_PRIs ACE_TEXT (" -g", argv0);
+ options.command_line (ACE_TEXT ("%") ACE_TEXT_PRIs ACE_TEXT (" -g"), argv0);
ACE_Process process;
if (process.spawn (options) == -1)
{