summaryrefslogtreecommitdiff
path: root/bignum.c
diff options
context:
space:
mode:
Diffstat (limited to 'bignum.c')
-rw-r--r--bignum.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bignum.c b/bignum.c
index 3ddc50c673..c58de5d5bb 100644
--- a/bignum.c
+++ b/bignum.c
@@ -920,7 +920,7 @@ bigdivrem(x, y, divp, modp)
if (modp) { /* just normalize remainder */
*modp = rb_big_clone(z);
zds = BDIGITS(*modp);
- while (!zds[ny-1]) ny--;
+ while (ny-- && !zds[ny]); ++ny;
if (dd) {
t2 = 0; i = ny;
while(i--) {