commit | 008413754ba588e6168c3d15280181fb2c331770 | [log] [tgz] |
---|---|---|
author | Denys Vlasenko <vda.linux@googlemail.com> | Sat Nov 23 17:25:21 2019 +0100 |
committer | Denys Vlasenko <vda.linux@googlemail.com> | Sat Nov 23 17:25:21 2019 +0100 |
tree | 63230968da2a89a25c269264986ee84622de8f4a | |
parent | d3539be8f27b8cbfdfee460fe08299158f08bcd9 [diff] [blame] |
bc: fix comparison bug, closes 12336 function old new delta bc_num_cmp 249 259 +10 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
diff --git a/miscutils/bc.c b/miscutils/bc.c index 92721d1..c7246ea 100644 --- a/miscutils/bc.c +++ b/miscutils/bc.c
@@ -1465,7 +1465,10 @@ b_int = BC_NUM_INT(b); a_int -= b_int; - if (a_int != 0) return (ssize_t) a_int; + if (a_int != 0) { + if (neg) return - (ssize_t) a_int; + return (ssize_t) a_int; + } a_max = (a->rdx > b->rdx); if (a_max) {