X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=lib%2Frandom.c;h=211986b722d00ae7bc41f7bf9a73e3935f152302;hb=a996044f96a0600122c4f208663ae79715868bbc;hp=87f7f544b5e95f47918e486610679c91a3a58c22;hpb=998c357a4f0c645fd73f69c9f18c5f78c0cfe9ca;p=libucw.git diff --git a/lib/random.c b/lib/random.c index 87f7f544..211986b7 100644 --- a/lib/random.c +++ b/lib/random.c @@ -19,6 +19,7 @@ random_max(uns max) { uns r, l; + ASSERT(max <= (1 << 30)); l = (RAND_MAX + 1U) - ((RAND_MAX + 1U) % max); do r = random();