]> granicus.if.org Git - apache/commitdiff
Fix some casting in mod_rewrite which broke random maps.
authorJeff Trawick <trawick@apache.org>
Tue, 11 Jun 2002 14:43:04 +0000 (14:43 +0000)
committerJeff Trawick <trawick@apache.org>
Tue, 11 Jun 2002 14:43:04 +0000 (14:43 +0000)
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
modules/mappers/mod_rewrite.c

diff --git a/CHANGES b/CHANGES
index a1ffc32be0f820e4f56e5da662351c25a2cd1daf..f21b2e4477af306836f0972325d8a989e6fe2f24 100644 (file)
--- 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
 
index 4061e78612e00c5f25615996fe9ccc45304508f5..cac38419d11b77c46355a2e3dee1a25e9180a527 100644 (file)
@@ -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)