diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2021-07-21 07:48:28 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-07-21 07:48:28 -0400 |
| commit | c12647b9907d12831c64e22195f5de5a07a56e45 (patch) | |
| tree | 002ea03045a0e5af06b4d836c7885f9c3aced5d3 /pathd/path_pcep_cli.c | |
| parent | 90737805d9160c068409cbac131e62a777e02cea (diff) | |
| parent | abfafdece24a0e12e21ee65903dde1cebc0c810e (diff) | |
Merge pull request #9094 from mjstapp/fix_pathd_pcep_localtime
pathd: don't use localtime
Diffstat (limited to 'pathd/path_pcep_cli.c')
| -rw-r--r-- | pathd/path_pcep_cli.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/pathd/path_pcep_cli.c b/pathd/path_pcep_cli.c index 2e4e331ad9..a911210ab4 100644 --- a/pathd/path_pcep_cli.c +++ b/pathd/path_pcep_cli.c @@ -505,7 +505,7 @@ static int path_pcep_cli_show_srte_pcep_counters(struct vty *vty) { int i, j, row; time_t diff_time; - struct tm *tm_info; + struct tm tm_info; char tm_buffer[26]; struct counters_group *group; struct counters_subgroup *subgroup; @@ -522,8 +522,8 @@ static int path_pcep_cli_show_srte_pcep_counters(struct vty *vty) } diff_time = time(NULL) - group->start_time; - tm_info = localtime(&group->start_time); - strftime(tm_buffer, sizeof(tm_buffer), "%Y-%m-%d %H:%M:%S", tm_info); + localtime_r(&group->start_time, &tm_info); + strftime(tm_buffer, sizeof(tm_buffer), "%Y-%m-%d %H:%M:%S", &tm_info); vty_out(vty, "PCEP counters since %s (%uh %um %us):\n", tm_buffer, (uint32_t)(diff_time / 3600), (uint32_t)((diff_time / 60) % 60), |
