aboutsummaryrefslogtreecommitdiff
path: root/toys/pending
diff options
context:
space:
mode:
authorGavin Howard <yzena.tech@gmail.com>2019-06-11 20:07:43 -0600
committerRob Landley <rob@landley.net>2019-06-12 01:20:00 -0500
commit1b7a19c72bac5e370488b387bdbffbc1ce78ba03 (patch)
tree2d8ba1ad9dcd43c6402a15649ecf92b4989445c7 /toys/pending
parentdddd1a13a9978cd17e9ad26637a0ce2da1466323 (diff)
downloadtoybox-1b7a19c72bac5e370488b387bdbffbc1ce78ba03.tar.gz
bc: fix previous patch
I put the check into the wrong if. That was my bad. Again.
Diffstat (limited to 'toys/pending')
-rw-r--r--toys/pending/bc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/toys/pending/bc.c b/toys/pending/bc.c
index b38d9872..7698a66b 100644
--- a/toys/pending/bc.c
+++ b/toys/pending/bc.c
@@ -1717,11 +1717,11 @@ static BcStatus bc_num_p(BcNum *a, BcNum *b, BcNum *c, size_t scale) {
if (b->rdx) return bc_vm_err(BC_ERROR_MATH_NON_INTEGER);
if (!b->len) {
- if (b->neg) return bc_vm_err(BC_ERROR_MATH_DIVIDE_BY_ZERO);
bc_num_one(c);
return BC_STATUS_SUCCESS;
}
if (!a->len) {
+ if (b->neg) return bc_vm_err(BC_ERROR_MATH_DIVIDE_BY_ZERO);
bc_num_setToZero(c, scale);
return BC_STATUS_SUCCESS;
}