From 219230e37824ba8ddb6113a7756dc2aa1ee2b0f2 Mon Sep 17 00:00:00 2001 From: Tom Marshall Date: Thu, 3 Dec 2015 13:16:26 -0800 Subject: recovery: Fix size of text array text_ is rendered using the log font, so alloc appropriately. Change-Id: If6306512978aff2f32bcee072a24cd6bdd042016 --- screen_ui.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'screen_ui.cpp') 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); } -- cgit v1.1