Browse Source

Windows: use srand() instead of srandom()

This is used for memory allocation failure debugging only

Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22347)
Tomas Mraz 6 months ago
parent
commit
3b107b86ca
1 changed files with 2 additions and 1 deletions
  1. 2 1
      crypto/mem.c

+ 2 - 1
crypto/mem.c

@@ -122,12 +122,13 @@ static void parseit(void)
 }
 
 /*
- * Windows doesn't have random(), but it has rand()
+ * Windows doesn't have random() and srandom(), but it has rand() and srand().
  * Some rand() implementations aren't good, but we're not
  * dealing with secure randomness here.
  */
 # ifdef _WIN32
 #  define random() rand()
+#  define srandom(seed) srand(seed)
 # endif
 /*
  * See if the current malloc should fail.