Bug 1964: GetInteger overflow

This commit is contained in:
Peter D. Barnes, Jr.
2014-09-12 13:03:06 -07:00
parent 3048ebcced
commit 070e2da241

View File

@@ -184,7 +184,7 @@ UniformRandomVariable::GetInteger (uint32_t min, uint32_t max)
{
NS_LOG_FUNCTION (this << min << max);
NS_ASSERT (min <= max);
return static_cast<uint32_t> ( GetValue (min, max + 1) );
return static_cast<uint32_t> ( GetValue ((double) (min), (double) (max) + 1.0) );
}
double