Pārlūkot izejas kodu

Fixed format string truncation warning in statistics.cpp

Stefan Schmidt 6 gadi atpakaļ
vecāks
revīzija
69e0d5b945
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  1. 1 1
      code_boost/src/cxx/statistics.cpp

+ 1 - 1
code_boost/src/cxx/statistics.cpp

@@ -665,7 +665,7 @@ std::string statistics::getFormattedTimestamp(time_t seconds, suseconds_t micros
     timeval tv;
     tv.tv_sec = seconds;
     tv.tv_usec = microseconds;
-    char tmbuf[64], buf[64];
+    char tmbuf[20], buf[64];
     auto nowtm = localtime(&(tv.tv_sec));
     strftime(tmbuf, sizeof(tmbuf), "%Y-%m-%d %H:%M:%S", nowtm);
     snprintf(buf, sizeof(buf), "%s.%06u", tmbuf, static_cast<uint>(tv.tv_usec));