summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2017-01-09 22:45:39 +0100
committerandroid-build-merger <android-build-merger@google.com>2017-01-09 22:45:39 +0100
commit931bc0c3d1813d7da31867f7e935db369a70270e (patch)
tree065336ed34d8c14e4c610d09a34288b1c631bee3
parentMerge "Retry ioctl in uncrypt if it returns block# 0" am: ceafe69fb8 am: 06b4254a70 (diff)
parentMerge "recovery: Fix the argument parsing." am: 33808f16c5 (diff)
downloadandroid_bootable_recovery-931bc0c3d1813d7da31867f7e935db369a70270e.tar
android_bootable_recovery-931bc0c3d1813d7da31867f7e935db369a70270e.tar.gz
android_bootable_recovery-931bc0c3d1813d7da31867f7e935db369a70270e.tar.bz2
android_bootable_recovery-931bc0c3d1813d7da31867f7e935db369a70270e.tar.lz
android_bootable_recovery-931bc0c3d1813d7da31867f7e935db369a70270e.tar.xz
android_bootable_recovery-931bc0c3d1813d7da31867f7e935db369a70270e.tar.zst
android_bootable_recovery-931bc0c3d1813d7da31867f7e935db369a70270e.zip
-rw-r--r--recovery.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/recovery.cpp b/recovery.cpp
index 5888c542a..fac241d63 100644
--- a/recovery.cpp
+++ b/recovery.cpp
@@ -322,7 +322,7 @@ static std::vector<std::string> get_args(const int argc, char** const argv) {
std::vector<std::string> args(argv, argv + argc);
// --- if arguments weren't supplied, look in the bootloader control block
- if (argc == 1) {
+ if (args.size() == 1) {
boot.recovery[sizeof(boot.recovery) - 1] = '\0'; // Ensure termination
std::string boot_recovery(boot.recovery);
std::vector<std::string> tokens = android::base::Split(boot_recovery, "\n");
@@ -338,7 +338,7 @@ static std::vector<std::string> get_args(const int argc, char** const argv) {
}
// --- if that doesn't work, try the command file (if we have /cache).
- if (argc == 1 && has_cache) {
+ if (args.size() == 1 && has_cache) {
std::string content;
if (ensure_path_mounted(COMMAND_FILE) == 0 &&
android::base::ReadFileToString(COMMAND_FILE, &content)) {