From 6a285edd520f9508efb76f30aff9812ce7115fa8 Mon Sep 17 00:00:00 2001 From: Miroslav Suk Date: Thu, 22 Mar 2018 09:20:43 +0100 Subject: [PATCH] o_time.c: use gmtime_s with MSVC Reviewed-by: Andy Polyakov Reviewed-by: Rich Salz (Merged from https://github.com/openssl/openssl/pull/5719) --- crypto/o_time.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crypto/o_time.c b/crypto/o_time.c index 61927439ea..a763b2ce20 100755 --- a/crypto/o_time.c +++ b/crypto/o_time.c @@ -109,6 +109,10 @@ struct tm *OPENSSL_gmtime(const time_t *timer, struct tm *result) if (gmtime_r(timer, result) == NULL) return NULL; ts = result; +#elif defined (OPENSSL_SYS_WINDOWS) && defined(_MSC_VER) && _MSC_VER >= 1400 + if (gmtime_s(result, timer)) + return NULL; + ts = result; #elif !defined(OPENSSL_SYS_VMS) || defined(VMS_GMTIME_OK) ts = gmtime(timer); if (ts == NULL) -- 2.25.1