From: MrSmör <66489839+MrSmoer@users.noreply.github.com> Date: Thu, 16 Nov 2023 12:31:50 +0000 (+0100) Subject: boot: padding for default arrow at too long lines X-Git-Tag: v256-rc1~801 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8b6cfbd2b84fdfa9f54f77b235c799d975f84d58;p=thirdparty%2Fsystemd.git 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. --- diff --git a/src/boot/efi/boot.c b/src/boot/efi/boot.c index f9b506808a1..1e1c6a433ed 100644 --- a/src/boot/efi/boot.c +++ b/src/boot/efi/boot.c @@ -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] = ' ';