X-Git-Url: https://git.distorted.org.uk/u/mdw/catacomb/blobdiff_plain/8823192f6413bed15cfa884ed3a3cbbb97885657..1793c2bb4617da22cc43954e8372645fd3c2d3c3:/mp-arith.c diff --git a/mp-arith.c b/mp-arith.c index aac408f..59198cf 100644 --- a/mp-arith.c +++ b/mp-arith.c @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: mp-arith.c,v 1.16.2.1 2003/06/10 13:21:10 mdw Exp $ + * $Id: mp-arith.c,v 1.16.2.2 2004/03/20 00:14:03 mdw Exp $ * * Basic arithmetic on multiprecision integers * @@ -30,6 +30,9 @@ /*----- Revision history --------------------------------------------------* * * $Log: mp-arith.c,v $ + * Revision 1.16.2.2 2004/03/20 00:14:03 mdw + * Bug fix. + * * Revision 1.16.2.1 2003/06/10 13:21:10 mdw * Fix bug dividing small things by large ones. * @@ -622,7 +625,7 @@ void mp_div(mp **qq, mp **rr, mp *a, mp *b) if (r) MP_DROP(r); r = a; - MP_DEST(r, MP_LEN(b) + 2, a->f | b->f); + MP_DEST(r, MAX(MP_LEN(a), MP_LEN(b)) + 2, a->f | b->f); /* --- Fix up the quotient too --- */