aboutsummaryrefslogtreecommitdiffstats
path: root/screen_ui.cpp
diff options
context:
space:
mode:
authorTom Marshall <tdm@cyngn.com>2015-12-03 13:16:26 -0800
committerTom Marshall <tdm@cyngn.com>2015-12-03 13:16:26 -0800
commit219230e37824ba8ddb6113a7756dc2aa1ee2b0f2 (patch)
tree92ff58255be4342413aaf8c34c22067badec5e1a /screen_ui.cpp
parentd4ca7f0fca235c273cc6968c762e2e1e536eefe0 (diff)
downloadbootable_recovery-219230e37824ba8ddb6113a7756dc2aa1ee2b0f2.tar.gz
bootable_recovery-219230e37824ba8ddb6113a7756dc2aa1ee2b0f2.tar.bz2
bootable_recovery-219230e37824ba8ddb6113a7756dc2aa1ee2b0f2.zip
recovery: Fix size of text array
text_ is rendered using the log font, so alloc appropriately. Change-Id: If6306512978aff2f32bcee072a24cd6bdd042016
Diffstat (limited to 'screen_ui.cpp')
-rw-r--r--screen_ui.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/screen_ui.cpp b/screen_ui.cpp
index b37c168..b292d37 100644
--- a/screen_ui.cpp
+++ b/screen_ui.cpp
@@ -502,7 +502,7 @@ void ScreenRecoveryUI::Init() {
log_text_rows_ = gr_fb_height() / log_char_height_;
log_text_cols_ = gr_fb_width() / log_char_width_;
- text_ = Alloc2d(text_rows_, text_cols_ + 1);
+ text_ = Alloc2d(log_text_rows_, log_text_cols_ + 1);
file_viewer_text_ = Alloc2d(text_rows_, text_cols_ + 1);
menu_ = Alloc2d(text_rows_, text_cols_ + 1);
@@ -681,8 +681,8 @@ void ScreenRecoveryUI::ClearText() {
text_col_ = 0;
text_row_ = 0;
text_top_ = 1;
- for (size_t i = 0; i < text_rows_; ++i) {
- memset(text_[i], 0, text_cols_ + 1);
+ for (size_t i = 0; i < log_text_rows_; ++i) {
+ memset(text_[i], 0, log_text_cols_ + 1);
}
pthread_mutex_unlock(&updateMutex);
}