From 15e6dfd7182b74b4fb6860f52fe314d0654307fb Mon Sep 17 00:00:00 2001 From: Reid Paape Date: Wed, 17 Jun 2020 06:58:12 -0500 Subject: [PATCH] timers: silence strncat truncation warning (#984) --- src/timers.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/timers.cc b/src/timers.cc index b9502443..4f76eddc 100644 --- a/src/timers.cc +++ b/src/timers.cc @@ -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); }