diff --git a/menu/drivers/glui.c b/menu/drivers/glui.c index 46829cd139..949e7129f9 100644 --- a/menu/drivers/glui.c +++ b/menu/drivers/glui.c @@ -305,16 +305,22 @@ static void glui_render_menu_list(glui_handle_t *glui, for (i = 0; i < end; i++) { bool entry_selected; - char entry_path[PATH_MAX_LENGTH] = {0}; - char entry_value[PATH_MAX_LENGTH] = {0}; - char message[PATH_MAX_LENGTH] = {0}; - char entry_title_buf[PATH_MAX_LENGTH] = {0}; - char type_str_buf[PATH_MAX_LENGTH] = {0}; + char entry_path[PATH_MAX_LENGTH]; + char entry_value[PATH_MAX_LENGTH]; + char message[PATH_MAX_LENGTH]; + char entry_title_buf[PATH_MAX_LENGTH]; + char type_str_buf[PATH_MAX_LENGTH]; int y = disp->header_height - menu->scroll_y + (glui->line_height * i); if (y > height || ((y + (int)glui->line_height) < 0)) continue; + entry_path[0] = '\0'; + entry_value[0] = '\0'; + message[0] = '\0'; + entry_title_buf[0] = '\0'; + type_str_buf[0] = '\0'; + entry_selected = menu_entry_is_currently_selected(i); menu_entry_get_value(i, entry_value, sizeof(entry_value)); menu_entry_get_path(i, entry_path, sizeof(entry_path)); @@ -337,10 +343,10 @@ static void glui_render_menu_list(glui_handle_t *glui, static void glui_frame(void) { unsigned width, height; - char title[PATH_MAX_LENGTH] = {0}; - char title_buf[PATH_MAX_LENGTH] = {0}; - char title_msg[PATH_MAX_LENGTH] = {0}; - char timedate[PATH_MAX_LENGTH] = {0}; + char title[PATH_MAX_LENGTH]; + char title_buf[PATH_MAX_LENGTH]; + char title_msg[PATH_MAX_LENGTH]; + char timedate[PATH_MAX_LENGTH]; gl_t *gl = NULL; glui_handle_t *glui = NULL; const struct font_renderer *font_driver = NULL; @@ -377,6 +383,11 @@ static void glui_frame(void) ) return; + title[0] = '\0'; + title_buf[0] = '\0'; + title_msg[0] = '\0'; + timedate[0] = '\0'; + video_driver_get_size(&width, &height); menu_display_set_viewport(); @@ -441,8 +452,9 @@ static void glui_frame(void) if (menu_input->keyboard.display) { - char msg[PATH_MAX_LENGTH] = {0}; + char msg[PATH_MAX_LENGTH]; const char *str = *menu_input->keyboard.buffer; + msg[0] = '\0'; if (!str) str = "";