diff options
author | Kevin Ryde <user42@zip.com.au> | 2002-12-27 21:50:16 +0100 |
---|---|---|
committer | Kevin Ryde <user42@zip.com.au> | 2002-12-27 21:50:16 +0100 |
commit | 85990ac2090a90d480255fb0a3cfd5559a7c19cf (patch) | |
tree | e7a810b182304b180244a131631a766dd3545941 /randmt.c | |
parent | afdc43a49843041b9a2d5cb15f4a32402ed9e514 (diff) | |
download | gmp-85990ac2090a90d480255fb0a3cfd5559a7c19cf.tar.gz |
2002-12-28 Pedro Gimeno <pggimeno@wanadoo.es>
* randmt.c (randseed_mt): Fix off-by-one bug on padding. Add
ASSERT checking result of mpz_export.
Diffstat (limited to 'randmt.c')
-rw-r--r-- | randmt.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -448,6 +448,8 @@ randseed_mt (gmp_randstate_t rstate, mpz_srcptr seed) /* Split seed1 into N-1 32-bit chunks. */ mpz_export (&p->mt[1], &cnt, -1, sizeof (p->mt[1]), 0, 8 * sizeof (p->mt[1]) - 32, seed1); + cnt++; + ASSERT (cnt <= N); while (cnt < N) p->mt[cnt++] = 0; |