From df2d56c03fd60d63fa5c2336186d4d80e08eb65c Mon Sep 17 00:00:00 2001 From: matz Date: Mon, 7 Oct 2002 07:44:18 +0000 Subject: * bignum.c (bigdivrem): bignum zero's len should not be 0. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2942 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- bignum.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bignum.c') diff --git a/bignum.c b/bignum.c index 0fa2233ebc..3cf4544cb4 100644 --- a/bignum.c +++ b/bignum.c @@ -1217,10 +1217,10 @@ bigdivrem(x, y, divp, modp) for (i = 0;i < j;i++) zds[i] = zds[i+ny]; RBIGNUM(*divp)->len = i; } - if (modp) { /* just normalize remainder */ + if (modp) { /* normalize remainder */ *modp = rb_big_clone(z); zds = BDIGITS(*modp); - while (ny-- && !zds[ny]); ++ny; + while (--ny && !zds[ny]); ++ny; if (dd) { t2 = 0; i = ny; while(i--) { -- cgit v1.2.3