From 1216a3f955aea8df7cc5c1468acf0f9589cd8b99 Mon Sep 17 00:00:00 2001 From: Michael Zingale Date: Tue, 19 Mar 2024 18:12:53 -0400 Subject: [PATCH] eliminate buffer --- Source/driver/Castro_io.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Source/driver/Castro_io.cpp b/Source/driver/Castro_io.cpp index 7289d09df1..e66a8b5ac9 100644 --- a/Source/driver/Castro_io.cpp +++ b/Source/driver/Castro_io.cpp @@ -575,10 +575,8 @@ Castro::writeJobInfo (const std::string& dir, const Real io_time) jobInfoFile << PrettyLine; const std::time_t now = time(nullptr); - char buf[64]; - if (strftime(buf, sizeof buf, "%c\n", std::localtime(&now))) { - jobInfoFile << "output date / time: " << buf << "\n"; - } + jobInfoFile << "output date / time: " + << std::put_time(std::localtime(&now), "%c\n") << "\n"; char currentDir[FILENAME_MAX]; if (getcwd(currentDir, FILENAME_MAX) != nullptr) {