This commit is contained in:
Pierre-Hugues Husson 2022-08-24 04:46:10 -04:00
parent 0c5eaf7d25
commit 5b3edfaf9d

View File

@ -41,11 +41,9 @@ int main(int argc, char **argv) {
} }
if(argc>=2 && strcmp(argv[1], "new-slot") == 0) { if(argc>=2 && strcmp(argv[1], "new-slot") == 0) {
std::string current_slot; std::string current_slot;
std::string next_slot; std::string next_slot = "a";
if(!android::base::ReadFileToString("/metadata/phh/img", &current_slot)) { if(android::base::ReadFileToString("/metadata/phh/img", &current_slot) &&
next_slot = "a"; current_slot.c_str()[0] == 'a') {
} else {
if(current_slot.c_str()[0] == 'a')
next_slot = "b"; next_slot = "b";
} }