Browse Source

Fixed format string truncation warning in statistics.cpp

Stefan Schmidt 6 years ago
parent
commit
69e0d5b945
1 changed files with 1 additions and 1 deletions
  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;
     timeval tv;
     tv.tv_sec = seconds;
     tv.tv_sec = seconds;
     tv.tv_usec = microseconds;
     tv.tv_usec = microseconds;
-    char tmbuf[64], buf[64];
+    char tmbuf[20], buf[64];
     auto nowtm = localtime(&(tv.tv_sec));
     auto nowtm = localtime(&(tv.tv_sec));
     strftime(tmbuf, sizeof(tmbuf), "%Y-%m-%d %H:%M:%S", nowtm);
     strftime(tmbuf, sizeof(tmbuf), "%Y-%m-%d %H:%M:%S", nowtm);
     snprintf(buf, sizeof(buf), "%s.%06u", tmbuf, static_cast<uint>(tv.tv_usec));
     snprintf(buf, sizeof(buf), "%s.%06u", tmbuf, static_cast<uint>(tv.tv_usec));