From a66d839167ae90575bf35f66327e3c138404dbb8 Mon Sep 17 00:00:00 2001 From: Gavin Howard Date: Sat, 23 Nov 2019 12:21:44 -0700 Subject: bc: fix a comparison bug --- toys/pending/bc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- cgit v1.2.3