summaryrefslogtreecommitdiff
path: root/crypto/o_str.c
diff options
context:
space:
mode:
authorAndy Polyakov <appro@openssl.org>2016-05-26 23:00:21 +0200
committerAndy Polyakov <appro@openssl.org>2016-05-27 23:01:37 +0200
commit43c4116cd7413b3c4ffc8d409eeac5b0262c4358 (patch)
tree6fdd52addb08123d15aef79c6d9b74590c4e9108 /crypto/o_str.c
parentbb83c8796b9e708a881f7c49a2af7921e73b2298 (diff)
downloadopenssl-new-43c4116cd7413b3c4ffc8d409eeac5b0262c4358.tar.gz
crypto/o_str.c: strerror_s is provided by specific compiler run-time,
not by OS [as was implied by guarding #if condition]. Reviewed-by: Matt Caswell <matt@openssl.org>
Diffstat (limited to 'crypto/o_str.c')
-rw-r--r--crypto/o_str.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/crypto/o_str.c b/crypto/o_str.c
index 98eb1631cb..4e2ef88e61 100644
--- a/crypto/o_str.c
+++ b/crypto/o_str.c
@@ -261,10 +261,8 @@ char *OPENSSL_buf2hexstr(const unsigned char *buffer, long len)
int openssl_strerror_r(int errnum, char *buf, size_t buflen)
{
-#if defined(OPENSSL_SYS_WINDOWS)
- if (strerror_s(buf, buflen, errnum) == EINVAL)
- return 0;
- return 1;
+#if defined(_MSC_VER) && _MSC_VER>=1400
+ return !strerror_s(buf, buflen, errnum);
#elif (_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !_GNU_SOURCE
/*
* We can use "real" strerror_r. The OpenSSL version differs in that it