Fix setting confirm flag
It was impossible to set confirm flag due to incorrect comparison.
In this point of time state->image_ok is already decoded and contains
one of following values:
If BOOT_FLAG_UNSET then we are ok to set a confirm flag.
Signed-off-by: Łukasz Rymanowski <lukasz.rymanowski@codecoup.pl>
diff --git a/boot/bootutil/src/bootutil_misc.c b/boot/bootutil/src/bootutil_misc.c
index 6d992b4..9fcea4e 100644
--- a/boot/bootutil/src/bootutil_misc.c
+++ b/boot/bootutil/src/bootutil_misc.c
@@ -574,7 +574,7 @@
goto done;
}
- if (state_slot0.image_ok != erased_val) {
+ if (state_slot0.image_ok != BOOT_FLAG_UNSET) {
/* Already confirmed. */
goto done;
}