summaryrefslogtreecommitdiff
path: root/bignum.c
diff options
context:
space:
mode:
Diffstat (limited to 'bignum.c')
-rw-r--r--bignum.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/bignum.c b/bignum.c
index 44775ff7f1..df66d33667 100644
--- a/bignum.c
+++ b/bignum.c
@@ -1848,13 +1848,13 @@ big_split(VALUE v, long n, volatile VALUE *ph, volatile VALUE *pl)
while (--hn && !vds[hn + ln]);
h = bignew(hn += 2, 1);
- MEMCPY(BDIGITS(h), vds + ln, BDIGIT, hn);
- BDIGITS(h)[hn - 1] = 0;
+ MEMCPY(BDIGITS(h), vds + ln, BDIGIT, hn - 1);
+ BDIGITS(h)[hn - 1] = 0; /* margin for carry */
while (--ln && !vds[ln]);
l = bignew(ln += 2, 1);
- MEMCPY(BDIGITS(l), vds, BDIGIT, ln);
- BDIGITS(l)[ln - 1] = 0;
+ MEMCPY(BDIGITS(l), vds, BDIGIT, ln - 1);
+ BDIGITS(l)[ln - 1] = 0; /* margin for carry */
*pl = l;
*ph = h;