diff options
Diffstat (limited to 'cpp/src')
-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; } |