Use memset_s() only if compiling in C11 mode.

This commit is contained in:
Frank Denis 2014-05-09 11:11:48 -07:00
parent cf8961a5bb
commit 290632a193

View File

@ -24,7 +24,7 @@ sodium_memzero(void * const pnt, const size_t len)
{
#ifdef HAVE_SECUREZEROMEMORY
SecureZeroMemory(pnt, len);
#elif defined(HAVE_MEMSET_S)
#elif defined(HAVE_MEMSET_S) && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201000L
if (memset_s(pnt, (rsize_t) len, 0, (rsize_t) len) != 0) {
abort();
}