summaryrefslogtreecommitdiff
path: root/libs/androidfw
diff options
context:
space:
mode:
authorYi Kong <yikong@google.com>2019-08-29 19:03:36 -0700
committerYi Kong <yikong@google.com>2019-08-30 02:09:30 +0000
commitf69c334dea6acdf47a90efb06bf14e67e0e803cf (patch)
treecee489bc13f8aed1214344db08b8e6c4380a1b4b /libs/androidfw
parentc53985fc51a64346e0a3eb71779b1bbd0b67605b (diff)
Fix reversed logic
To check if a value falls in a range, it should be a >= MIN && a <= MAX instead of a >= MIN || a <= MAX Found by an experimental Clang warning change, https://reviews.llvm.org/D66044. Test: presubmit Change-Id: I91e2a04687285d9311fd831197c73af38ec8379c
Diffstat (limited to 'libs/androidfw')
-rw-r--r--libs/androidfw/ResourceTypes.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/libs/androidfw/ResourceTypes.cpp b/libs/androidfw/ResourceTypes.cpp
index 861dc0f3879c..b79ffa540de5 100644
--- a/libs/androidfw/ResourceTypes.cpp
+++ b/libs/androidfw/ResourceTypes.cpp
@@ -7344,12 +7344,12 @@ void ResTable::print_value(const Package* pkg, const Res_value& value) const
print_complex(value.data, true);
printf("\n");
} else if (value.dataType >= Res_value::TYPE_FIRST_COLOR_INT
- || value.dataType <= Res_value::TYPE_LAST_COLOR_INT) {
+ && value.dataType <= Res_value::TYPE_LAST_COLOR_INT) {
printf("(color) #%08x\n", value.data);
} else if (value.dataType == Res_value::TYPE_INT_BOOLEAN) {
printf("(boolean) %s\n", value.data ? "true" : "false");
} else if (value.dataType >= Res_value::TYPE_FIRST_INT
- || value.dataType <= Res_value::TYPE_LAST_INT) {
+ && value.dataType <= Res_value::TYPE_LAST_INT) {
printf("(int) 0x%08x or %d\n", value.data, value.data);
} else {
printf("(unknown type) t=0x%02x d=0x%08x (s=0x%04x r=0x%02x)\n",