boot: padding for default arrow at too long lines

If the default boot entry name doesnt leave enough space for the
indicator arrow, it overwrote the first two characters of the entry

Now every line will always have enough padding.
This commit is contained in:
MrSmör
2024-02-20 14:36:52 +01:00
committed by Lennart Poettering
parent ce3fa3863d
commit 8b6cfbd2b8
+3
View File
@@ -746,6 +746,9 @@ static bool menu_run(
lines[i] = xnew(char16_t, line_width + 1);
padding = (line_width - MIN(strlen16(config->entries[i]->title_show), line_width)) / 2;
/* Make sure there is space for => */
padding = MAX((size_t) 2, padding);
for (j = 0; j < padding; j++)
lines[i][j] = ' ';