mp_rand_source(NULL) sets to platform random source

This commit is contained in:
Daniel Mendler 2019-05-08 15:17:37 +02:00
parent 9e28ef9fa2
commit 56fb5e4a9a
No known key found for this signature in database
GPG Key ID: D88ADB2A2693CA43

View File

@ -165,7 +165,7 @@ static int (*s_rand_source)(void *, size_t) = s_mp_rand_source_platform;
void mp_rand_source(int (*get)(void *out, size_t size))
{
s_rand_source = get;
s_rand_source = get == NULL ? s_mp_rand_source_platform : get;
}
/* makes a pseudo-random int of a given size */