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
* 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)