aboutsummaryrefslogtreecommitdiff
path: root/src/util.cpp
diff options
context:
space:
mode:
authorGavin Andresen <gavinandresen@gmail.com>2011-12-19 17:08:25 -0500
committerLuke Dashjr <luke-jr+git@utopios.org>2012-06-14 20:38:25 +0000
commit0ce74bfaa5f34351e5b23e19ee90e7367bd50245 (patch)
treea4445dd77cc0964fca7aa1514aaf324f278350fb /src/util.cpp
parent3703150d56ff6ee557ab330e55637c9c23835902 (diff)
downloadbitcoin-0ce74bfaa5f34351e5b23e19ee90e7367bd50245.tar.xz
Use std::numeric_limits<> for typesafe INT_MAX/etc
(this fixes a Mac OS X gitian build error for 0.5.x)
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 6314b53627..0311203828 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -144,7 +144,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));