timers: silence strncat truncation warning (#984)

This commit is contained in:
Reid Paape 2020-06-17 06:58:12 -05:00 committed by GitHub
parent 76efbcdd1b
commit 15e6dfd718
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);
}