[INTERPRETER]

* BUG: Prevent the use of seed 0 for the random-number generator, by 
  replacing it by -1 if Randomize 0 is requested.


git-svn-id: svn://localhost/gambas/trunk@7426 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
Benoît Minisini 2015-10-18 21:10:13 +00:00
parent 297a3a6a15
commit 061bb35502

View file

@ -54,6 +54,9 @@ static void GFSR_init(uint seed)
int i = 0, j; int i = 0, j;
uint t = seed; uint t = seed;
if (t == 0)
t = (uint)-1;
do do
{ {
t ^= (t >> 5) ^ (t << 1); t ^= (t >> 5) ^ (t << 1);