bootutil: loader: fix BOOT_STATUS_ASSERT macro
BOOT_STATUS_ASSERT increments the variable if the macro argument
is evaluated as true, which is incorrect behavior compared to the
ASSERT macro.
Signed-off-by: Johann Fischer <j.fischer@phytec.de>
diff --git a/boot/bootutil/src/loader.c b/boot/bootutil/src/loader.c
index d7b08f6..a71b87a 100644
--- a/boot/bootutil/src/loader.c
+++ b/boot/bootutil/src/loader.c
@@ -47,7 +47,7 @@
static int boot_status_fails = 0;
#define BOOT_STATUS_ASSERT(x) \
do { \
- if (x) { \
+ if (!(x)) { \
boot_status_fails++; \
} \
} while (0)