fixed an initialization bug in mod-math.c

This commit is contained in:
hyung-hwan 2020-04-12 19:05:15 +00:00
parent e4de922f7d
commit 6664621a45
2 changed files with 2 additions and 2 deletions

View File

@ -713,7 +713,7 @@ int hawk_mod_math (hawk_mod_t* mod, hawk_t* awk)
hawk_get_time (&tv); hawk_get_time (&tv);
modctx->seed = tv.sec + tv.nsec; modctx->seed = tv.sec + tv.nsec;
#if defined(HAVE_INITSTATE_R) && defined(HAVE_SRANDOM_R) && defined(HAVE_RANDOM_R) #if defined(HAVE_INITSTATE_R) && defined(HAVE_SRANDOM_R) && defined(HAVE_RANDOM_R)
initstate_r (0, &modctx->prand_bin, HAWK_SIZEOF(&modctx->prand_bin), &modctx->prand); initstate_r (0, modctx->prand_bin, HAWK_SIZEOF(modctx->prand_bin), &modctx->prand);
srandom_r (modctx->seed, &modctx->prand); srandom_r (modctx->seed, &modctx->prand);
#elif defined(HAVE_RANDOM) #elif defined(HAVE_RANDOM)
srandom (modctx->seed); srandom (modctx->seed);