summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2013-11-27 13:43:45 -0800
committerH. Peter Anvin <hpa@linux.intel.com>2013-11-27 13:43:45 -0800
commit3143a462c261fb3a4d38ef504e855ebfc1514c6d (patch)
tree6e7c2c7e4556dd6afe1a939108a6aa69f4504e8c
parentafcb66f41281104c8dc70f628eeaedda67b13b97 (diff)
downloadnasm-3143a462c261fb3a4d38ef504e855ebfc1514c6d.tar.gz
nasm-3143a462c261fb3a4d38ef504e855ebfc1514c6d.tar.bz2
nasm-3143a462c261fb3a4d38ef504e855ebfc1514c6d.zip
disasm: Don't rely on iflag_cmp() returning +/-1
It is safer to just rely on the sign, for future options. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
-rw-r--r--disasm.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/disasm.c b/disasm.c
index b7c5027..bb53b4c 100644
--- a/disasm.c
+++ b/disasm.c
@@ -1338,7 +1338,8 @@ int32_t disasm(uint8_t *data, char *output, int outbufsize, int segsize,
if (tmp_ins.prefixes[i])
nprefix++;
if (nprefix < best_pref ||
- (nprefix == best_pref && iflag_cmp(&goodness, &best) == -1)) {
+ (nprefix == best_pref &&
+ iflag_cmp(&goodness, &best) < 0)) {
/* This is the best one found so far */
best = goodness;
best_p = p;