summaryrefslogtreecommitdiff
path: root/src/urandomb.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/urandomb.c')
-rw-r--r--src/urandomb.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/urandomb.c b/src/urandomb.c
index c3de8fb75..b913e987e 100644
--- a/src/urandomb.c
+++ b/src/urandomb.c
@@ -98,6 +98,8 @@ mpfr_urandomb (mpfr_ptr rop, gmp_randstate_t rstate)
}
if (cnt != 0)
mpn_lshift (rp + k, rp, nlimbs, cnt);
+ else if (k != 0)
+ mpn_copyi (rp + k, rp, nlimbs);
if (k != 0)
MPN_ZERO (rp, k);
}