summaryrefslogtreecommitdiffstats
path: root/Source/CTest/cmCTestVC.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/CTest/cmCTestVC.cxx')
-rw-r--r--Source/CTest/cmCTestVC.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/Source/CTest/cmCTestVC.cxx b/Source/CTest/cmCTestVC.cxx
index 423b506..d5711c5 100644
--- a/Source/CTest/cmCTestVC.cxx
+++ b/Source/CTest/cmCTestVC.cxx
@@ -123,9 +123,10 @@ std::string cmCTestVC::GetNightlyTime()
this->CTest->GetCTestConfiguration("NightlyStartTime"),
this->CTest->GetTomorrowTag());
char current_time[1024];
- sprintf(current_time, "%04d-%02d-%02d %02d:%02d:%02d", t->tm_year + 1900,
- t->tm_mon + 1, t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec);
- return std::string(current_time);
+ snprintf(current_time, sizeof(current_time), "%04d-%02d-%02d %02d:%02d:%02d",
+ t->tm_year + 1900, t->tm_mon + 1, t->tm_mday, t->tm_hour, t->tm_min,
+ t->tm_sec);
+ return { current_time };
}
void cmCTestVC::Cleanup()