From b4af2571dbee9dab5717bb166ed63df5ae63974b Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Fri, 9 Aug 2024 15:00:14 +0200 Subject: [PATCH] tests: use put_time --- test/lib/brick-shelltest.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/test/lib/brick-shelltest.h b/test/lib/brick-shelltest.h index 15e21cca7..1b65bd9ea 100644 --- a/test/lib/brick-shelltest.h +++ b/test/lib/brick-shelltest.h @@ -319,12 +319,9 @@ struct Journal { of << ru->second; else { struct tm time_info; - char buf[64]; time_t t = time( 0 ); - if (localtime_r(&t, &time_info)) { - strftime(buf, sizeof(buf), "%F %T", &time_info); - of << "--- " << buf << " ---"; - } + if (localtime_r(&t, &time_info)) + of << "--- " << std::put_time( &time_info, "%F %T" ) << " ---"; } of << std::endl; }