From: William A. Rowe Jr Date: Sat, 16 Mar 2002 23:44:20 +0000 (+0000) Subject: Resolve bugs introduced by my Rev 1.173, which attempted to close X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=657f666735ec2e5a4e2977edfd643234919e5146;p=thirdparty%2Fapache%2Fhttpd.git 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 --- 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)