]> git.ipfire.org Git - thirdparty/chrony.git/commit
test: fix incorrect use of RAND_MAX
authorMiroslav Lichvar <mlichvar@redhat.com>
Thu, 23 Sep 2021 07:34:47 +0000 (09:34 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Thu, 23 Sep 2021 13:51:35 +0000 (15:51 +0200)
commit9600993c282d15353987f35b2b0f7475b37da5c4
treee3dbb7075d55fb7ef8bb4f562d475bce75455474
parent5e6f8458ffae79f45546cbee60247b1d060b5887
test: fix incorrect use of RAND_MAX

On some systems (e.g. Solaris/OpenIndiana) rand() and random() have
different ranges. RAND_MAX is the maximum value returned by rand(),
but random() should always have a range of 0 through 2^31-1.

This fixes multiple failures in different tests.
test/unit/test.c