mirror of
https://github.com/google/benchmark.git
synced 2024-12-28 21:40:15 +08:00
timers: silence strncat truncation warning (#984)
This commit is contained in:
parent
76efbcdd1b
commit
15e6dfd718
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user