diff options
author | Torbjorn Granlund <tege@gmplib.org> | 2012-05-26 15:57:43 +0200 |
---|---|---|
committer | Torbjorn Granlund <tege@gmplib.org> | 2012-05-26 15:57:43 +0200 |
commit | eb3632bb2177f6ea7d2f41c9722458c10159c013 (patch) | |
tree | 624a47bf95ce22460938a693f797937f5d6003cb /mpz/random2.c | |
parent | 27ac5bf5c349d49c7103674b4a366afb6ad51cca (diff) | |
download | gmp-eb3632bb2177f6ea7d2f41c9722458c10159c013.tar.gz |
Use MPZ_REALLOC return value when possible.
Diffstat (limited to 'mpz/random2.c')
-rw-r--r-- | mpz/random2.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/mpz/random2.c b/mpz/random2.c index c9274c158..cc4cfef31 100644 --- a/mpz/random2.c +++ b/mpz/random2.c @@ -2,7 +2,7 @@ long runs of consecutive ones and zeros in the binary representation. Meant for testing of other MP routines. -Copyright 1991, 1993, 1994, 1996, 2001 Free Software Foundation, Inc. +Copyright 1991, 1993, 1994, 1996, 2001, 2012 Free Software Foundation, Inc. This file is part of the GNU MP Library. @@ -26,13 +26,14 @@ void mpz_random2 (mpz_ptr x, mp_size_t size) { mp_size_t abs_size; + mp_ptr xp; abs_size = ABS (size); if (abs_size != 0) { - MPZ_REALLOC (x, abs_size); + xp = MPZ_REALLOC (x, abs_size); - mpn_random2 (PTR (x), abs_size); + mpn_random2 (xp, abs_size); } SIZ (x) = size; |