Use labs(rand()) instead of abs(rand()) in tommath
Originally by Christos Zoulas.
This commit is contained in:

committed by
Viktor Dukhovni

parent
369945f5bc
commit
352ff15477
@@ -163,7 +163,7 @@ mp_digit prime_digit(void)
|
||||
int n;
|
||||
mp_digit d;
|
||||
|
||||
n = labs(rand()) % n_prime;
|
||||
n = abs(rand()) % n_prime;
|
||||
fseek(primes, n * sizeof(mp_digit), SEEK_SET);
|
||||
fread(&d, 1, sizeof(mp_digit), primes);
|
||||
return d;
|
||||
|
Reference in New Issue
Block a user