summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2022-09-23 18:28:51 +0200
committerAdam Mitz <mitza@objectcomputing.com>2022-10-03 13:21:54 -0500
commit9dc726c1ef239348516d792b94b8317dd5924767 (patch)
treef92158d2096cfed44a89661597dee0d4f8a8d10b
parenta33cf7cd35bb9735823fa1276617c38edbd8b385 (diff)
downloadATCD-9dc726c1ef239348516d792b94b8317dd5924767.tar.gz
Merge pull request #1943 from lukem/format-security-fixup
Fix -Wformat-security issues in examples (cherry picked from commit 697cb84ee1a1ebc3aed0e3b3437f246a7c34f3fb)
-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 827e7ec4ccb..7ed44665763 100644
--- a/ACE/examples/OS/Process/imore.cpp
+++ b/ACE/examples/OS/Process/imore.cpp
@@ -241,7 +241,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 ();
@@ -261,7 +261,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 fa411cbc00b..369e7b34f2c 100644
--- a/ACE/examples/OS/Process/process.cpp
+++ b/ACE/examples/OS/Process/process.cpp
@@ -125,7 +125,7 @@ test_more (void)
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)
@@ -154,7 +154,7 @@ static void
test_date (void)
{
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;
@@ -458,7 +458,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)
{