aboutsummaryrefslogtreecommitdiff
path: root/src/util.cpp
diff options
context:
space:
mode:
authorGavin Andresen <gavinandresen@gmail.com>2011-12-19 17:08:25 -0500
committerGavin Andresen <gavinandresen@gmail.com>2011-12-19 19:10:34 -0500
commit26ce92b3526430d4a40b2faccef4facb966d6a0a (patch)
treee23a92f6152c3abcf8cf3c42bf5a5b50ecc5dc42 /src/util.cpp
parentbd846c0e565ca0db276cb6b7eac7763bebe19b84 (diff)
downloadbitcoin-26ce92b3526430d4a40b2faccef4facb966d6a0a.tar.xz
Use std::numeric_limits<> for typesafe INT_MAX/etc
Diffstat (limited to 'src/util.cpp')
-rw-r--r--src/util.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/util.cpp b/src/util.cpp
index ef276e5103..80ce404593 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -133,7 +133,7 @@ uint64 GetRand(uint64 nMax)
// The range of the random source must be a multiple of the modulus
// to give every possible output value an equal possibility
- uint64 nRange = (UINT64_MAX / nMax) * nMax;
+ uint64 nRange = (std::numeric_limits<uint64>::max() / nMax) * nMax;
uint64 nRand = 0;
do
RAND_bytes((unsigned char*)&nRand, sizeof(nRand));