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)
This commit is contained in:
Tomas Mraz 2023-10-11 11:20:02 +02:00
parent 10767fd9db
commit 3b107b86ca

View File

@ -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.