diff options
author | Tao Bao <tbao@google.com> | 2015-09-03 19:37:28 +0200 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-09-03 19:37:28 +0200 |
commit | 9edbb3b42e83d2d362c02bc1d4e9d5000958446a (patch) | |
tree | ae2128dbfcf5899d6e335376daec2caf12dd6c1c | |
parent | am ceb81e49: am 1b3195cb: am 4c223f4e: Merge "Add slot_suffix field to struct bootloader_message." (diff) | |
parent | am 8e9c6801: recovery: Fix the bug that truncates menu entries. (diff) | |
download | android_bootable_recovery-9edbb3b42e83d2d362c02bc1d4e9d5000958446a.tar android_bootable_recovery-9edbb3b42e83d2d362c02bc1d4e9d5000958446a.tar.gz android_bootable_recovery-9edbb3b42e83d2d362c02bc1d4e9d5000958446a.tar.bz2 android_bootable_recovery-9edbb3b42e83d2d362c02bc1d4e9d5000958446a.tar.lz android_bootable_recovery-9edbb3b42e83d2d362c02bc1d4e9d5000958446a.tar.xz android_bootable_recovery-9edbb3b42e83d2d362c02bc1d4e9d5000958446a.tar.zst android_bootable_recovery-9edbb3b42e83d2d362c02bc1d4e9d5000958446a.zip |
-rw-r--r-- | wear_ui.cpp | 7 |
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'; } |