Use labs(rand()) instead of abs(rand()) in tommath

Originally by Christos Zoulas.
This commit is contained in:
Nicolas Williams
2017-01-31 11:39:55 -06:00
committed by Viktor Dukhovni
parent 369945f5bc
commit 352ff15477
5 changed files with 8 additions and 7 deletions

View File

@@ -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;