summaryrefslogtreecommitdiffstats
path: root/recovery.cpp
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2015-05-06 21:40:05 +0200
committerElliott Hughes <enh@google.com>2015-05-07 06:20:10 +0200
commitdf52e1e119804cc5e7d0b7f77a7d1bf42b2da9dc (patch)
tree2b3e8ccbd8b85e5e74a28fb4ca7f7d07b6685b29 /recovery.cpp
parentuncrypt: Switch to C++ (diff)
downloadandroid_bootable_recovery-df52e1e119804cc5e7d0b7f77a7d1bf42b2da9dc.tar
android_bootable_recovery-df52e1e119804cc5e7d0b7f77a7d1bf42b2da9dc.tar.gz
android_bootable_recovery-df52e1e119804cc5e7d0b7f77a7d1bf42b2da9dc.tar.bz2
android_bootable_recovery-df52e1e119804cc5e7d0b7f77a7d1bf42b2da9dc.tar.lz
android_bootable_recovery-df52e1e119804cc5e7d0b7f77a7d1bf42b2da9dc.tar.xz
android_bootable_recovery-df52e1e119804cc5e7d0b7f77a7d1bf42b2da9dc.tar.zst
android_bootable_recovery-df52e1e119804cc5e7d0b7f77a7d1bf42b2da9dc.zip
Diffstat (limited to 'recovery.cpp')
-rw-r--r--recovery.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/recovery.cpp b/recovery.cpp
index 2c78bafac..80a8c7ba5 100644
--- a/recovery.cpp
+++ b/recovery.cpp
@@ -701,12 +701,11 @@ static bool wipe_cache(bool should_confirm, Device* device) {
}
static void choose_recovery_file(Device* device) {
- // "Go back" + KEEP_LOG_COUNT * 2 + terminating nullptr entry
- char* entries[KEEP_LOG_COUNT * 2 + 2];
+ // "Back" + KEEP_LOG_COUNT * 2 + terminating nullptr entry
+ char* entries[1 + KEEP_LOG_COUNT * 2 + 1];
memset(entries, 0, sizeof(entries));
unsigned int n = 0;
- entries[n++] = strdup("Go back");
// Add LAST_LOG_FILE + LAST_LOG_FILE.x
// Add LAST_KMSG_FILE + LAST_KMSG_FILE.x
@@ -734,11 +733,13 @@ static void choose_recovery_file(Device* device) {
}
}
+ entries[n++] = strdup("Back");
+
const char* headers[] = { "Select file to view", nullptr };
while (true) {
int chosen_item = get_menu_selection(headers, entries, 1, 0, device);
- if (chosen_item == 0) break;
+ if (strcmp(entries[chosen_item], "Back") == 0) break;
// TODO: do we need to redirect? ShowFile could just avoid writing to stdio.
redirect_stdio("/dev/null");