summaryrefslogtreecommitdiffstats
path: root/Source/cmExecuteProcessCommand.cxx
diff options
context:
space:
mode:
authorSean McBride <sean@rogue-research.com>2021-10-21 16:35:57 (GMT)
committerSean McBride <sean@rogue-research.com>2021-10-25 22:23:13 (GMT)
commit5ba6e8ac59333aa574d5963332e3ef0f4c4d3514 (patch)
treed796f695e10d5ec20508cb04f4c8b3c2a6c0d742 /Source/cmExecuteProcessCommand.cxx
parent0ce50dd78f68b697e1ab29d52d733b87c5bfb67d (diff)
downloadCMake-5ba6e8ac59333aa574d5963332e3ef0f4c4d3514.zip
CMake-5ba6e8ac59333aa574d5963332e3ef0f4c4d3514.tar.gz
CMake-5ba6e8ac59333aa574d5963332e3ef0f4c4d3514.tar.bz2
Source: Replace most calls to sprintf with snprintf
Diffstat (limited to 'Source/cmExecuteProcessCommand.cxx')
-rw-r--r--Source/cmExecuteProcessCommand.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/cmExecuteProcessCommand.cxx b/Source/cmExecuteProcessCommand.cxx
index ffcc415..3b990cc 100644
--- a/Source/cmExecuteProcessCommand.cxx
+++ b/Source/cmExecuteProcessCommand.cxx
@@ -318,7 +318,7 @@ bool cmExecuteProcessCommand(std::vector<std::string> const& args,
case cmsysProcess_State_Exited: {
int v = cmsysProcess_GetExitValue(cp);
char buf[16];
- sprintf(buf, "%d", v);
+ snprintf(buf, sizeof(buf), "%d", v);
status.GetMakefile().AddDefinition(arguments.ResultVariable, buf);
} break;
case cmsysProcess_State_Exception:
@@ -346,7 +346,7 @@ bool cmExecuteProcessCommand(std::vector<std::string> const& args,
int exitCode =
cmsysProcess_GetExitValueByIndex(cp, static_cast<int>(i));
char buf[16];
- sprintf(buf, "%d", exitCode);
+ snprintf(buf, sizeof(buf), "%d", exitCode);
res.emplace_back(buf);
} break;
case kwsysProcess_StateByIndex_Exception: