]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Resolve bugs introduced by my Rev 1.173, which attempted to close
authorWilliam A. Rowe Jr <wrowe@apache.org>
Sat, 16 Mar 2002 23:44:20 +0000 (23:44 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Sat, 16 Mar 2002 23:44:20 +0000 (23:44 +0000)
  a type mismatch error.  This truncation should now produce a random
  result, once again.  PR 10090, 10185

  Bug pinpointed by Jeroen Boomgaardt <jeroen@swissclue.com>

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

index 70747dcfd299194065bf9a55985e0f22d99b332c..91665abafc8195108b531a30d76265f069bec9f3 100644 (file)
@@ -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)