From 20881b2fa0ffab500cf9cfdd8ce590e49c029aab Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 11 Jun 2002 14:43:04 +0000 Subject: [PATCH] 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 --- CHANGES | 2 ++ modules/mappers/mod_rewrite.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) 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) -- 2.40.0