You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Ben Laurie <be...@algroup.co.uk> on 1998/03/05 21:43:15 UTC

Re: cvs commit: apache-1.3/src/modules/standard mod_rewrite.c

Ralf S. Engelschall wrote:
> 
> rse         98/03/04 23:50:33
> 
>   Modified:    src/modules/standard mod_rewrite.c
>   Log:
>   Make sure the returned value of rand() is not greater then RAND_MAX on systems
>   like SunOS where we guessed the RAND_MAX value. This the way Ben requested but
>   without the "+1" because this actually leaded to an overflow warning under
>   compiletime and is not really needed because this is random number generating
>   functions where it doesn't count because of the additional bounding checks.

The snag is that if h is RAND_MAX and l is 0, then you will never get h.
No big deal for realistic scenarios, I'd imagine :-)

Cheers,

Ben.

-- 
Ben Laurie            |Phone: +44 (181) 735 0686|  Apache Group member
Freelance Consultant  |Fax:   +44 (181) 735 0689|http://www.apache.org
and Technical Director|Email: ben@algroup.co.uk |
A.L. Digital Ltd,     |Apache-SSL author    http://www.apache-ssl.org/
London, England.      |"Apache: TDG" http://www.ora.com/catalog/apache