X-Git-Url: https://mattmccutchen.net/bigint/bigint.git/blobdiff_plain/b1f5f69ee6a55e326f1336a3967513fd22f57d7f..918d66f23e6b2528010db6f121e229f488fe3410:/BigUnsigned.cc diff --git a/BigUnsigned.cc b/BigUnsigned.cc index a2ab58c..10c47db 100644 --- a/BigUnsigned.cc +++ b/BigUnsigned.cc @@ -752,8 +752,10 @@ void BigUnsigned::operator ++() { } if (carry) { // Matt fixed a bug 2004.12.24: next 2 lines used to say allocateAndCopy(len + 1) + // Matt fixed another bug 2006.04.24: + // old number only has len blocks, so copy before increasing length + allocateAndCopy(len + 1); len++; - allocateAndCopy(len); blk[i] = 1; } }