[mythtv-commits] [MythTV/mythtv] 181a1b: Negative random value where positive value is requ...
noreply at github.com
Sat Jan 9 20:18:14 UTC 2021
Author: Klaas de Waal <kdewaal at mythtv.org>
Date: 2021-01-09 (Sat, 09 Jan 2021)
Negative random value where positive value is required
The function MythRandom(), introduced in commit 31a811e54e21ac4160a3ed533f965eb9caeb4f7b,
does create a 32-bit random value which is returned in an uint32_t.
This new function does replace the Linux system call random() which returns an int.
Note that int value returned by random() is always positive.
In places where an int is required the output of MythRandom() is cast to an int.
This value can however be negative and will be approximately 50% of the times it is called.
This is now fixed in the places where it had not been fixed alreay.
More information about the mythtv-commits