aboutsummaryrefslogtreecommitdiff
path: root/random.c
diff options
context:
space:
mode:
Diffstat (limited to 'random.c')
-rw-r--r--random.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/random.c b/random.c
index 5527d6f..bd11f16 100644
--- a/random.c
+++ b/random.c
@@ -254,12 +254,12 @@ unsigned long random_bits(random_state *state, int bits)
}
/*
- * `(1 << bits) - 1' is not good enough, since if bits==32 on a
+ * `(1UL << bits) - 1' is not good enough, since if bits==32 on a
* 32-bit machine, behaviour is undefined and Intel has a nasty
* habit of shifting left by zero instead. We'll shift by
* bits-1 and then separately shift by one.
*/
- ret &= (1 << (bits-1)) * 2 - 1;
+ ret &= (1UL << (bits-1)) * 2 - 1;
return ret;
}