diff --git a/src/libsodium/sodium/core.c b/src/libsodium/sodium/core.c index ae6ed071..79004ef0 100644 --- a/src/libsodium/sodium/core.c +++ b/src/libsodium/sodium/core.c @@ -83,7 +83,7 @@ static int _sodium_crit_enter(void) { if (InterlockedCompareExchange(&_sodium_lock_initialized, - 1L, 0L) != 0L) { + 1L, 0L) == 0L) { InitializeCriticalSection(_sodium_lock); InterlockedIncrement(&_sodium_lock_initialized); } else {