]> sourceware.org Git - lvm2.git/commitdiff
tests: use put_time
authorZdenek Kabelac <zkabelac@redhat.com>
Fri, 9 Aug 2024 13:00:14 +0000 (15:00 +0200)
committerZdenek Kabelac <zkabelac@redhat.com>
Fri, 9 Aug 2024 13:10:24 +0000 (15:10 +0200)
test/lib/brick-shelltest.h

index 15e21cca74ec0c024499d5006620be19733466e9..1b65bd9eac1a2d33fce0e3cc22f50f356f1cd105 100644 (file)
@@ -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;
             }
This page took 0.036837 seconds and 5 git commands to generate.