From d1b1b4272a84696689574b3bcdc2ee5bd39a9796 Mon Sep 17 00:00:00 2001 From: Christoph Sommer Date: Mon, 26 Jun 2006 14:21:57 +0000 Subject: [PATCH] Tried fixing assert error on Windows SVN-Revision: 3764 --- src/random_generator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/random_generator.cpp b/src/random_generator.cpp index ecb95ba9d..c8eac09d4 100644 --- a/src/random_generator.cpp +++ b/src/random_generator.cpp @@ -53,7 +53,7 @@ RandomGenerator::~RandomGenerator() { int RandomGenerator::srand(int x) { while (x == 0) // random seed of zero means - x = time(0); // randomize with time + x = (time(0) % RAND_MAX); // randomize with time assert(x < RAND_MAX); // only allow posative 31-bit seeds assert(sizeof(int) >= 4); srandom(x); -- 2.11.0