diff options
-rw-r--r-- | crypto_scrypt-check.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/crypto_scrypt-check.c b/crypto_scrypt-check.c index c889a7c..5ed7ab0 100644 --- a/crypto_scrypt-check.c +++ b/crypto_scrypt-check.c @@ -7,6 +7,12 @@ #include "slowequals.h" #include "libscrypt.h" +#ifdef _WIN32 +/* On windows, strtok uses a thread-local static variable in strtok to + * make strtok thread-safe. It also neglects to provide a strtok_r. */ +#define strtok_r(str, val, saveptr) strtok((str), (val)) +#endif + /* pow() works with doubles. Sounds like it should cast to int correctly, * but doesn't always. This is faster anyway */ @@ -32,7 +38,9 @@ int libscrypt_check(char *mcf, const char *password) * >0 correct password */ +#ifndef _WIN32 char *saveptr = NULL; +#endif uint32_t params; uint64_t N; uint8_t r, p; |