From a2700b5071e53a78be2f8098765dcca58c2b6ee5 Mon Sep 17 00:00:00 2001 From: Mark Stapp Date: Thu, 5 Mar 2020 11:42:12 -0500 Subject: *: use gmtime_r, localtime_r exclusively Stop using gmtime() or localtime() everywhere. Signed-off-by: Mark Stapp --- lib/keychain.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/keychain.c') diff --git a/lib/keychain.c b/lib/keychain.c index fc9f0f9cfa..ea512a2699 100644 --- a/lib/keychain.c +++ b/lib/keychain.c @@ -967,12 +967,12 @@ static struct cmd_node keychain_key_node = {KEYCHAIN_KEY_NODE, static int keychain_strftime(char *buf, int bufsiz, time_t *time) { - struct tm *tm; + struct tm tm; size_t len; - tm = localtime(time); + localtime_r(time, &tm); - len = strftime(buf, bufsiz, "%T %b %d %Y", tm); + len = strftime(buf, bufsiz, "%T %b %d %Y", &tm); return len; } -- cgit v1.2.3