diff options
author | Benoit Foucher <benoit@zeroc.com> | 2006-03-24 10:39:50 +0000 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2006-03-24 10:39:50 +0000 |
commit | f0bd740edd421c68ee90596f5b6ed73a94ded080 (patch) | |
tree | b7a286d8a15ce3dd127ce42ec5cd70d82455eb4b /cpp/src/IceUtil/Random.cpp | |
parent | fix VC6 build error. (diff) | |
download | ice-f0bd740edd421c68ee90596f5b6ed73a94ded080.tar.bz2 ice-f0bd740edd421c68ee90596f5b6ed73a94ded080.tar.xz ice-f0bd740edd421c68ee90596f5b6ed73a94ded080.zip |
Added tests for generateRandom.
Diffstat (limited to 'cpp/src/IceUtil/Random.cpp')
-rw-r--r-- | cpp/src/IceUtil/Random.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cpp/src/IceUtil/Random.cpp b/cpp/src/IceUtil/Random.cpp index e7cd4c18a31..501e6582cd8 100644 --- a/cpp/src/IceUtil/Random.cpp +++ b/cpp/src/IceUtil/Random.cpp @@ -197,5 +197,5 @@ IceUtil::random(int limit) { int r; generateRandom(reinterpret_cast<char*>(&r), sizeof(int)); - return r % limit; + return limit == 0 ? r : r % limit; } |