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:
Andrey A. Chernov 2013-07-03 23:27:04 +00:00
parent be28275d00
commit df5c65e22a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=252648

View file

@ -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);
}