summaryrefslogtreecommitdiffstats
path: root/Source/cmStateSnapshot.cxx
diff options
context:
space:
mode:
authorjrp2014 <jrp2014@users.noreply.github.com>2018-04-04 11:41:50 (GMT)
committerBrad King <brad.king@kitware.com>2018-04-05 19:34:23 (GMT)
commitacda926a047c5958af32fd6f88dd184f5d769319 (patch)
tree360cb51d88aa0ca1094ffcdafcaa47af6c60121f /Source/cmStateSnapshot.cxx
parent418541035f82327ff387363efebcf18de7feffc9 (diff)
downloadCMake-acda926a047c5958af32fd6f88dd184f5d769319.zip
CMake-acda926a047c5958af32fd6f88dd184f5d769319.tar.gz
CMake-acda926a047c5958af32fd6f88dd184f5d769319.tar.bz2
Replace some uses of sprintf with std::to_string
Diffstat (limited to 'Source/cmStateSnapshot.cxx')
-rw-r--r--Source/cmStateSnapshot.cxx19
1 files changed, 9 insertions, 10 deletions
diff --git a/Source/cmStateSnapshot.cxx b/Source/cmStateSnapshot.cxx
index 479ecd2..0d97c33 100644
--- a/Source/cmStateSnapshot.cxx
+++ b/Source/cmStateSnapshot.cxx
@@ -6,7 +6,7 @@
#include <algorithm>
#include <assert.h>
#include <iterator>
-#include <stdio.h>
+#include <string>
#include "cmAlgorithms.h"
#include "cmDefinitions.h"
@@ -328,15 +328,14 @@ void cmStateSnapshot::SetDefaultDefinitions()
this->SetDefinition("CMAKE_HOST_SOLARIS", "1");
#endif
- char temp[1024];
- sprintf(temp, "%d", cmVersion::GetMinorVersion());
- this->SetDefinition("CMAKE_MINOR_VERSION", temp);
- sprintf(temp, "%d", cmVersion::GetMajorVersion());
- this->SetDefinition("CMAKE_MAJOR_VERSION", temp);
- sprintf(temp, "%d", cmVersion::GetPatchVersion());
- this->SetDefinition("CMAKE_PATCH_VERSION", temp);
- sprintf(temp, "%d", cmVersion::GetTweakVersion());
- this->SetDefinition("CMAKE_TWEAK_VERSION", temp);
+ this->SetDefinition("CMAKE_MAJOR_VERSION",
+ std::to_string(cmVersion::GetMajorVersion()));
+ this->SetDefinition("CMAKE_MINOR_VERSION",
+ std::to_string(cmVersion::GetMinorVersion()));
+ this->SetDefinition("CMAKE_PATCH_VERSION",
+ std::to_string(cmVersion::GetPatchVersion()));
+ this->SetDefinition("CMAKE_TWEAK_VERSION",
+ std::to_string(cmVersion::GetTweakVersion()));
this->SetDefinition("CMAKE_VERSION", cmVersion::GetCMakeVersion());
this->SetDefinition("CMAKE_FILES_DIRECTORY",