From: Jeff Trawick Date: Tue, 11 Jun 2002 14:43:04 +0000 (+0000) Subject: Fix some casting in mod_rewrite which broke random maps. X-Git-Tag: 2.0.38~96 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=20881b2fa0ffab500cf9cfdd8ce590e49c029aab;p=apache Fix some casting in mod_rewrite which broke random maps. PR: 9770 Submitted by: Allan Edwards, Greg Ames, Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95611 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index a1ffc32be0..f21b2e4477 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,8 @@ Changes with Apache 2.0.38 + *) Fix some casting in mod_rewrite which broke random maps. + PR 9770 [Allan Edwards, Greg Ames, Jeff Trawick] Changes with Apache 2.0.37 diff --git a/modules/mappers/mod_rewrite.c b/modules/mappers/mod_rewrite.c index 4061e78612..cac38419d1 100644 --- a/modules/mappers/mod_rewrite.c +++ b/modules/mappers/mod_rewrite.c @@ -3088,7 +3088,7 @@ static int rewrite_rand(int l, int h) * result. Doing an integer modulus would only use the lower-order bits * which may not be as uniformly random. */ - return (int)((double)(rand() % RAND_MAX) / RAND_MAX) * (h - l + 1) + l; + return (int)(((double)(rand() % RAND_MAX) / RAND_MAX) * (h - l + 1) + l); } static char *select_random_value_part(request_rec *r, char *value)