summaryrefslogtreecommitdiff
path: root/mpz/import.c
diff options
context:
space:
mode:
authorMarco Bodrato <bodrato@mail.dm.unipi.it>2013-02-12 15:40:31 +0100
committerMarco Bodrato <bodrato@mail.dm.unipi.it>2013-02-12 15:40:31 +0100
commita48fddf29870af5f7d62efebafc26697a0e1b09e (patch)
tree8790fd5855f46eb3aa4235cf457ce0699fd8ce65 /mpz/import.c
parente7d68730074437aa411e602c3bae38628a780a0a (diff)
downloadgmp-a48fddf29870af5f7d62efebafc26697a0e1b09e.tar.gz
mpz/import.c, mpz/inp_raw.c: Use BITS_TO_LIMBS and MPZ_NEWALLOC.
Diffstat (limited to 'mpz/import.c')
-rw-r--r--mpz/import.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mpz/import.c b/mpz/import.c
index 1585d67e1..a3f0cc993 100644
--- a/mpz/import.c
+++ b/mpz/import.c
@@ -46,8 +46,8 @@ mpz_import (mpz_ptr z, size_t count, int order,
ASSERT (endian == 1 || endian == 0 || endian == -1);
ASSERT (nail <= 8*size);
- zsize = (count * (8*size - nail) + GMP_NUMB_BITS-1) / GMP_NUMB_BITS;
- zp = MPZ_REALLOC (z, zsize);
+ zsize = BITS_TO_LIMBS (count * (8*size - nail));
+ zp = MPZ_NEWALLOC (z, zsize);
if (endian == 0)
endian = HOST_ENDIAN;