diff options
| author | Mark Stapp <mjs@labn.net> | 2023-09-19 13:15:21 -0400 |
|---|---|---|
| committer | Mark Stapp <mjs@labn.net> | 2023-09-19 16:25:01 -0400 |
| commit | 8527084488e9d37386788feb755e21db706210d3 (patch) | |
| tree | ca3f5a3c162cdd2406089d9e65780ff85b5d4a9f /bgpd/bgp_nexthop.c | |
| parent | e7f0bbb1980660bdcf4595e88b60eadd41a0a172 (diff) | |
bgpd: replace ctime with ctime_r
No ctime, use ctime_r.
Signed-off-by: Mark Stapp <mjs@labn.net>
Diffstat (limited to 'bgpd/bgp_nexthop.c')
| -rw-r--r-- | bgpd/bgp_nexthop.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/bgpd/bgp_nexthop.c b/bgpd/bgp_nexthop.c index 7f1a6e73e1..d12dc22330 100644 --- a/bgpd/bgp_nexthop.c +++ b/bgpd/bgp_nexthop.c @@ -972,6 +972,7 @@ static void bgp_show_nexthop(struct vty *vty, struct bgp *bgp, { char buf[PREFIX2STR_BUFFER]; time_t tbuf; + char timebuf[32]; struct peer *peer; json_object *json_last_update = NULL; json_object *json_nexthop = NULL; @@ -1070,14 +1071,14 @@ static void bgp_show_nexthop(struct vty *vty, struct bgp *bgp, json_last_update = json_object_new_object(); json_object_int_add(json_last_update, "epoch", tbuf); json_object_string_add(json_last_update, "string", - ctime(&tbuf)); + ctime_r(&tbuf, timebuf)); json_object_object_add(json_nexthop, "lastUpdate", json_last_update); } else { json_object_int_add(json_nexthop, "lastUpdate", tbuf); } } else { - vty_out(vty, " Last update: %s", ctime(&tbuf)); + vty_out(vty, " Last update: %s", ctime_r(&tbuf, timebuf)); } /* show paths dependent on nexthop, if needed. */ |
