summaryrefslogtreecommitdiff
path: root/py
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2015-04-22 23:16:49 +0100
committerDamien George <damien.p.george@gmail.com>2015-04-22 23:16:49 +0100
commitf66ee4dfd70608461cd35c2d91d217337193f547 (patch)
tree4964b970112a3263e788481bba351cd49d95cd76 /py
parent8f6aad2f4896beb06c5cbb8f983d7c183dd10788 (diff)
py/mpz.c: Fix bug with shl not truncating zero digits correctly.
Diffstat (limited to 'py')
-rw-r--r--py/mpz.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/py/mpz.c b/py/mpz.c
index f54bde8b5..241fa79be 100644
--- a/py/mpz.c
+++ b/py/mpz.c
@@ -97,7 +97,7 @@ STATIC mp_uint_t mpn_shl(mpz_dig_t *idig, mpz_dig_t *jdig, mp_uint_t jlen, mp_ui
// work out length of result
jlen += n_whole;
- if (idig[jlen - 1] == 0) {
+ while (jlen != 0 && idig[jlen - 1] == 0) {
jlen--;
}