mirror of
https://github.com/systemd/systemd.git
synced 2025-03-22 06:50:18 +03:00
random-util: actually encode our expectations on RAND_MAX
This commit is contained in:
parent
f1eb0ccd9e
commit
57ee010ff2
@ -325,9 +325,11 @@ void initialize_srand(void) {
|
||||
|
||||
/* INT_MAX gives us only 31 bits, so use 24 out of that. */
|
||||
#if RAND_MAX >= INT_MAX
|
||||
assert_cc(RAND_MAX >= 16777215);
|
||||
# define RAND_STEP 3
|
||||
#else
|
||||
/* SHORT_INT_MAX or lower gives at most 15 bits, we just just 8 out of that. */
|
||||
/* SHORT_INT_MAX or lower gives at most 15 bits, we just use 8 out of that. */
|
||||
assert_cc(RAND_MAX >= 255);
|
||||
# define RAND_STEP 1
|
||||
#endif
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user