On Sun, Jul 13, 2014 at 04:03:53PM +0200, Brent Cook wrote:
> On Jul 13, 2014, at 3:58 PM, Ted Unangst <t...@tedunangst.com> wrote:
> > @@ -411,6 +404,9 @@ static long
> > random_l(void)
> > {
> >     int32_t i;
> > +
> > +   if (use_arc4random)
> > +           return arc4random() & 0x7fffffff;
> 
> return arc4random() % ((unsigned)RAND_MAX + 1) ?

No. RAND_MAX is for rand() not random().

>From posix for random():
    The random() function shall use a non-linear additive feedback
    random-number generator employing a default state array size of
    31 long integers to return successive pseudo-random numbers in
    the range from 0 to 2^31 - 1.

>From posix for rand():
    The rand() function shall compute a sequence of pseudo-random
    integers in the range [0, {RAND_MAX}]

Reply via email to