mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-17 13:53:39 +00:00
In addition to prev. commit, for repeated rand_r(3) calls don't forget
to compensate back at the end incremented at the start internal state. MFC after: 2 weeks
This commit is contained in:
parent
be28275d00
commit
df5c65e22a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=252648
|
@ -90,7 +90,11 @@ rand_r(unsigned int *ctx)
|
|||
#endif
|
||||
int r = do_rand(&val);
|
||||
|
||||
*ctx = (unsigned int) val;
|
||||
#ifdef USE_WEAK_SEEDING
|
||||
*ctx = (unsigned int)val;
|
||||
#else
|
||||
*ctx = (unsigned int)(val - 1);
|
||||
#endif
|
||||
return (r);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue