summaryrefslogtreecommitdiff
path: root/src/program.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/program.c')
-rw-r--r--src/program.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/program.c b/src/program.c
index 1a8176c76f96..3c2544f8a61f 100644
--- a/src/program.c
+++ b/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));