stdlib: automatically seed PRNG with srand(1)

This commit is contained in:
Lephenixnoir 2023-03-19 00:24:28 +01:00
parent 7eb2a6e8ab
commit 74b805e8b5
Signed by untrusted user: Lephenixnoir
GPG Key ID: 1BBA026E13FC0495
1 changed files with 6 additions and 0 deletions

View File

@ -12,3 +12,9 @@ int rand(void)
{
return tinymt32_generate_uint32(&random) & 0x7fffffff;
}
__attribute__((constructor))
static void init_prng(void)
{
srand(1);
}