mirror of
https://github.com/google/benchmark.git
synced 2025-01-30 05:40:15 +08:00
timers: silence format overflow warning
This commit is contained in:
parent
99c52f1414
commit
f6ac240cd2
@ -212,8 +212,10 @@ std::string LocalDateTimeString() {
|
|||||||
offset_minutes *= -1;
|
offset_minutes *= -1;
|
||||||
tz_offset_sign = '-';
|
tz_offset_sign = '-';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Apply % 100 to hour to guarantee range [0, 99].
|
||||||
tz_len = ::sprintf(tz_offset, "%c%02li:%02li", tz_offset_sign,
|
tz_len = ::sprintf(tz_offset, "%c%02li:%02li", tz_offset_sign,
|
||||||
offset_minutes / 100, offset_minutes % 100);
|
(offset_minutes / 100) % 100, offset_minutes % 100);
|
||||||
CHECK(tz_len == 6);
|
CHECK(tz_len == 6);
|
||||||
((void)tz_len); // Prevent unused variable warning in optimized build.
|
((void)tz_len); // Prevent unused variable warning in optimized build.
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user