mirror of
https://gitee.com/openharmony/third_party_benchmark
synced 2024-11-23 07:20:12 +00: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