projects
/
oweals
/
busybox.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
bc: fix comparison bug, closes 12336
[oweals/busybox.git]
/
miscutils
/
bc.c
diff --git
a/miscutils/bc.c
b/miscutils/bc.c
index 92721d18fc9212cfd31b82c0dd454394b3f445c0..c7246ea1a1610195e78de07d9e09b4e38535fcdd 100644
(file)
--- a/
miscutils/bc.c
+++ b/
miscutils/bc.c
@@
-1465,7
+1465,10
@@
static ssize_t bc_num_cmp(BcNum *a, BcNum *b)
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) {