aboutsummaryrefslogtreecommitdiff
path: root/toys
diff options
context:
space:
mode:
authorGavin Howard <yzena.tech@gmail.com>2019-11-23 12:21:44 -0700
committerRob Landley <rob@landley.net>2019-11-24 03:22:06 -0600
commita66d839167ae90575bf35f66327e3c138404dbb8 (patch)
tree250e495398f9c8058f1dc004e6e66f66141f9cd5 /toys
parent05fe7ad1b632848978dc259e74f0aff741dd83d3 (diff)
downloadtoybox-a66d839167ae90575bf35f66327e3c138404dbb8.tar.gz
bc: fix a comparison bug
Diffstat (limited to 'toys')
-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 5d0e98e9..2d927551 100644
--- a/toys/pending/bc.c
+++ b/toys/pending/bc.c
@@ -1197,7 +1197,7 @@ ssize_t bc_num_cmp(BcNum *a, BcNum *b) {
a_int -= b_int;
a_max = (a->rdx > b->rdx);
- if (a_int) return (ssize_t) a_int;
+ if (a_int) return neg ? -((ssize_t) a_int) : (ssize_t) a_int;
if (a_max) {
min = b->rdx;