X-Git-Url: https://mattmccutchen.net/bigint/bigint.git/blobdiff_plain/26a5f52b24d9c9733139a6cf29647f1de7915a56..be1bdfe2b1863ad12b104fadb6bbbb4524724146:/BigUnsigned.cc diff --git a/BigUnsigned.cc b/BigUnsigned.cc index 33fe0af..ecf1055 100644 --- a/BigUnsigned.cc +++ b/BigUnsigned.cc @@ -562,8 +562,9 @@ void BigUnsigned::divideWithRemainder(const BigUnsigned &b, BigUnsigned &q) { * amusing story of this section of code. */ Index origLen = len; // Save real length. + // 2006.05.03: Copy the number and then change the length! + allocateAndCopy(len + 1); // Get the space. len++; // Increase the length. - allocateAndCopy(len); // Get the space. blk[origLen] = 0; // Zero the extra block. // work2 holds part of the result of a subtraction; see above.