summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bignum.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bignum.c b/bignum.c
index fc713a00cd..3f59b8edf9 100644
--- a/bignum.c
+++ b/bignum.c
@@ -2812,7 +2812,7 @@ bigdivrem(VALUE x, VALUE y, volatile VALUE *divp, volatile VALUE *modp)
if (modp) { /* normalize remainder */
*modp = zz = rb_big_clone(z);
zds = BDIGITS(zz);
- while (--ny && !zds[ny]); ++ny;
+ while (ny > 0 && !zds[ny-1]) --ny;
if (dd) {
t2 = 0; i = ny;
while(i--) {