summaryrefslogtreecommitdiffstats
path: root/wear_ui.cpp
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2015-09-02 20:20:30 +0200
committerTao Bao <tbao@google.com>2015-09-02 23:38:23 +0200
commit8e9c68019f9c284b89155c71922ad8ac84af6ab6 (patch)
treeda09d23420b358bd14eac600efaca18128a45016 /wear_ui.cpp
parentrecovery: Factor out wear_ui.{cpp,h} into bootable/recovery. (diff)
downloadandroid_bootable_recovery-8e9c68019f9c284b89155c71922ad8ac84af6ab6.tar
android_bootable_recovery-8e9c68019f9c284b89155c71922ad8ac84af6ab6.tar.gz
android_bootable_recovery-8e9c68019f9c284b89155c71922ad8ac84af6ab6.tar.bz2
android_bootable_recovery-8e9c68019f9c284b89155c71922ad8ac84af6ab6.tar.lz
android_bootable_recovery-8e9c68019f9c284b89155c71922ad8ac84af6ab6.tar.xz
android_bootable_recovery-8e9c68019f9c284b89155c71922ad8ac84af6ab6.tar.zst
android_bootable_recovery-8e9c68019f9c284b89155c71922ad8ac84af6ab6.zip
Diffstat (limited to '')
-rw-r--r--wear_ui.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/wear_ui.cpp b/wear_ui.cpp
index 4ae42c467..55b7afc8f 100644
--- a/wear_ui.cpp
+++ b/wear_ui.cpp
@@ -482,7 +482,12 @@ void WearRecoveryUI::StartMenu(const char* const * headers, const char* const *
if (text_rows > 0 && text_cols > 0) {
menu_headers_ = headers;
size_t i = 0;
- for (; i < text_rows && items[i] != nullptr; i++) {
+ // "i < text_rows" is removed from the loop termination condition,
+ // which is different from the one in ScreenRecoveryUI::StartMenu().
+ // Because WearRecoveryUI supports scrollable menu, it's fine to have
+ // more entries than text_rows. The menu may be truncated otherwise.
+ // Bug: 23752519
+ for (; items[i] != nullptr; i++) {
strncpy(menu[i], items[i], text_cols - 1);
menu[i][text_cols - 1] = '\0';
}