menu: Fix maybe uninitialised issue with cur_len var

This commit is contained in:
mintsuki 2023-07-27 23:17:36 -05:00
parent 478b6f3806
commit d73cd37834
1 changed files with 1 additions and 1 deletions

View File

@ -510,6 +510,7 @@ static size_t print_tree(size_t offset, size_t window, const char *shift, size_t
}
for (;;) {
size_t cur_len = 0;
if (current_entry == NULL)
break;
if (!no_print && base_index + max_entries < offset) {
@ -519,7 +520,6 @@ static size_t print_tree(size_t offset, size_t window, const char *shift, size_t
goto skip_line;
}
if (!no_print) print("%s", shift);
size_t cur_len = shift ? strlen(shift) : 0;
if (level) {
for (size_t i = level - 1; i > 0; i--) {
struct menu_entry *actual_parent = current_entry;