android: fix compare slot_suffix error

If slot_suffix is equal to "_a", slot_index_to_boot is equal to '0'
but not '1' when use function strncmp.

Change-Id: I53ffc920824e03c923f1d9ab8fd326a733c59654
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
This commit is contained in:
Jason Zhu 2018-12-03 10:59:03 +08:00 committed by Kever Yang
parent 6b7594123f
commit 270ed4a992
1 changed files with 2 additions and 2 deletions

View File

@ -481,9 +481,9 @@ static AvbSlotVerifyResult android_slot_verify(char *boot_partname,
return AVB_SLOT_VERIFY_RESULT_ERROR_IO;
}
if (strncmp(slot_suffix, "_a", 2))
if (!strncmp(slot_suffix, "_a", 2))
slot_index_to_boot = 0;
else if(strncmp(slot_suffix, "_b", 2))
else if (!strncmp(slot_suffix, "_b", 2))
slot_index_to_boot = 1;
else
slot_index_to_boot = 0;