Commit 4d8b7484 authored by Lev Walkin's avatar Lev Walkin

fix random range

parent 3e3f61af
......@@ -26,5 +26,5 @@ asn_random_between(intmax_t a, intmax_t b) {
assert(a <= b);
assert((b-a) < RAND_MAX);
if(a == b) return a;
return a + (random() % (b - a));
return a + (random() % (b - a + 1));
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment