diff options
| author | Rafael Zalamena <rzalamena@opensourcerouting.org> | 2023-01-23 08:16:39 -0300 |
|---|---|---|
| committer | Rafael Zalamena <rzalamena@opensourcerouting.org> | 2023-01-23 08:16:39 -0300 |
| commit | 5d543b3fd26c66af0d66306a737e91a875fc9898 (patch) | |
| tree | 561dd95de9c9016e990368eb7df710a8f24d68bf | |
| parent | 23acae3b87603b135465482f540066858166006b (diff) | |
isisd: fix time truncation on display
Use a larger storage to keep the `time_t` that is platform agnostic and
use the appropriated printing primitive.
Found by Coverity Scan (CID 1519793)
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
| -rw-r--r-- | isisd/isis_spf.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/isisd/isis_spf.c b/isisd/isis_spf.c index 89e751b4e6..a6eef75e7e 100644 --- a/isisd/isis_spf.c +++ b/isisd/isis_spf.c @@ -2714,12 +2714,14 @@ void isis_spf_init(void) void isis_spf_print(struct isis_spftree *spftree, struct vty *vty) { + uint64_t last_run_duration = spftree->last_run_duration; + vty_out(vty, " last run elapsed : "); vty_out_timestr(vty, spftree->last_run_timestamp); vty_out(vty, "\n"); - vty_out(vty, " last run duration : %u usec\n", - (uint32_t)spftree->last_run_duration); + vty_out(vty, " last run duration : %" PRIu64 " usec\n", + last_run_duration); vty_out(vty, " run count : %u\n", spftree->runcount); } |
