From 5d543b3fd26c66af0d66306a737e91a875fc9898 Mon Sep 17 00:00:00 2001 From: Rafael Zalamena Date: Mon, 23 Jan 2023 08:16:39 -0300 Subject: [PATCH] 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 --- isisd/isis_spf.c | 6 ++++-- 1 file 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); } -- 2.39.5