From 657f666735ec2e5a4e2977edfd643234919e5146 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 16 Mar 2002 23:44:20 +0000 Subject: [PATCH] Resolve bugs introduced by my Rev 1.173, which attempted to close a type mismatch error. This truncation should now produce a random result, once again. PR 10090, 10185 Bug pinpointed by Jeroen Boomgaardt git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x@93974 13f79535-47bb-0310-9956-ffa450edef68 --- src/modules/standard/mod_rewrite.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/standard/mod_rewrite.c b/src/modules/standard/mod_rewrite.c index 70747dcfd29..91665abafc8 100644 --- a/src/modules/standard/mod_rewrite.c +++ b/src/modules/standard/mod_rewrite.c @@ -3013,7 +3013,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.47.2