From: Miroslav Suk Date: Thu, 22 Mar 2018 08:20:43 +0000 (+0100) Subject: o_time.c: use gmtime_s with MSVC X-Git-Tag: OpenSSL_1_0_2p~96 X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff_plain;h=6a285edd520f9508efb76f30aff9812ce7115fa8 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) --- 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)