summaryrefslogtreecommitdiffstats
path: root/lib/bfd.c
diff options
context:
space:
mode:
authorMark Stapp <mjs@voltanet.io>2020-03-05 17:42:12 +0100
committerMark Stapp <mjs@voltanet.io>2020-03-05 19:26:16 +0100
commita2700b5071e53a78be2f8098765dcca58c2b6ee5 (patch)
treee32654991ac297bd3917401ae429ee54da385e5e /lib/bfd.c
parentMerge pull request #5890 from mjstapp/zapi_allow_label_num (diff)
downloadfrr-a2700b5071e53a78be2f8098765dcca58c2b6ee5.tar.xz
frr-a2700b5071e53a78be2f8098765dcca58c2b6ee5.zip
*: use gmtime_r, localtime_r exclusively
Stop using gmtime() or localtime() everywhere. Signed-off-by: Mark Stapp <mjs@voltanet.io>
Diffstat (limited to 'lib/bfd.c')
-rw-r--r--lib/bfd.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/bfd.c b/lib/bfd.c
index 4e192422c..a75618c06 100644
--- a/lib/bfd.c
+++ b/lib/bfd.c
@@ -328,7 +328,7 @@ static void bfd_last_update(time_t last_update, char *buf, size_t len)
{
time_t curr;
time_t diff;
- struct tm *tm;
+ struct tm tm;
struct timeval tv;
/* If no BFD satatus update has ever been received, print `never'. */
@@ -341,10 +341,10 @@ static void bfd_last_update(time_t last_update, char *buf, size_t len)
monotime(&tv);
curr = tv.tv_sec;
diff = curr - last_update;
- tm = gmtime(&diff);
+ gmtime_r(&diff, &tm);
- snprintf(buf, len, "%d:%02d:%02d:%02d", tm->tm_yday, tm->tm_hour,
- tm->tm_min, tm->tm_sec);
+ snprintf(buf, len, "%d:%02d:%02d:%02d", tm.tm_yday, tm.tm_hour,
+ tm.tm_min, tm.tm_sec);
}
/*