Unverified Commit 15e6dfd7 by Reid Paape Committed by GitHub

timers: silence strncat truncation warning (#984)

parent 76efbcdd
......@@ -235,10 +235,9 @@ std::string LocalDateTimeString() {
timeinfo_p);
CHECK(timestamp_len == kTimestampLen);
// Prevent unused variable warning in optimized build.
((void)timestamp_len);
((void)kTimestampLen);
std::strncat(storage, tz_offset, kTzOffsetLen + 1);
std::strncat(storage, tz_offset, sizeof(storage) - timestamp_len - 1);
return std::string(storage);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment