diff options
Diffstat (limited to 'contrib/bc/src/program.c')
-rw-r--r-- | contrib/bc/src/program.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/contrib/bc/src/program.c b/contrib/bc/src/program.c index 20b301e5bc05..a14887e7f135 100644 --- a/contrib/bc/src/program.c +++ b/contrib/bc/src/program.c @@ -1271,12 +1271,13 @@ static void bc_program_divmod(BcProgram *p) { BcNum *n1, *n2; size_t req; + bc_vec_expand(&p->results, p->results.len + 2); + + // We don't need to update the pointer because + // the capacity is enough due to the line above. res2 = bc_program_prepResult(p); res = bc_program_prepResult(p); - // Update the pointer, just in case. - res2 = bc_vec_item_rev(&p->results, 1); - bc_program_binOpPrep(p, &opd1, &n1, &opd2, &n2, 2); req = bc_num_mulReq(n1, n2, BC_PROG_SCALE(p)); |