summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
Diffstat (limited to 'util')
-rw-r--r--util/ifdtool/ifdtool.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/util/ifdtool/ifdtool.c b/util/ifdtool/ifdtool.c
index ccd27d0dc4..69cd2a9fef 100644
--- a/util/ifdtool/ifdtool.c
+++ b/util/ifdtool/ifdtool.c
@@ -1153,11 +1153,8 @@ static int regions_collide(const region_t *r1, const region_t *r2)
if ((r1->size == 0) || (r2->size == 0))
return 0;
- if ( ((r1->base >= r2->base) && (r1->base <= r2->limit)) ||
- ((r1->limit >= r2->base) && (r1->limit <= r2->limit)) )
- return 1;
-
- return 0;
+ /* r1 should be either completely below or completely above r2 */
+ return !(r1->limit < r2->base || r1->base > r2->limit);
}
void new_layout(const char *filename, char *image, int size,