Dag-Erling Smorgrav wrote:

[EMAIL PROTECTED] writes:

Well, I'm right in principle but wrong in current practice, at
the very least make it:

#define arc4random31()   (arc4random() & RAND_MAX)

or rather

#define arc4random31()   (arc4random() % (RAND_MAX + 1))

to avoid relying on RAND_MAX being one less than a power of two.

DES


Nope.  Because RAND_MAX is one less than a power of two,
you run into integer overflow problems, which PHK's
version avoids.


Tim Kientzle


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to