mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-05-19 17:03:19 +00:00
Merge pull request #13707 from LabNConsulting/chopps/coverity-strftime
mgmtd: assert an assertion for coverity
This commit is contained in:
commit
75a95e1ccd
@ -74,9 +74,11 @@ mgmt_time_to_string(struct timespec *tv, bool long_fmt, char *buffer, size_t sz)
|
||||
|
||||
if (long_fmt) {
|
||||
n = strftime(buffer, sz, MGMT_LONG_TIME_FMT, &tm);
|
||||
assert(n < sz);
|
||||
snprintf(&buffer[n], sz - n, ",%09lu", tv->tv_nsec);
|
||||
} else {
|
||||
n = strftime(buffer, sz, MGMT_SHORT_TIME_FMT, &tm);
|
||||
assert(n < sz);
|
||||
snprintf(&buffer[n], sz - n, "%09lu", tv->tv_nsec);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user