loader: Increase buffer size to accommodate longer commands

The longest command we have is "efi-autoresizecons". That combined with
the two spaces before and after the command gives us a total of 23
characters including the null-terminator.

Also move the two trailing spaces to their own pager_output call so they
don't get truncated if the command is too long and increase the minimum
string length to 20 in order to fix alignment issues caused by the
increased buffer size.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1277
This commit is contained in:
Ahmad Khalifa 2024-06-05 03:32:58 +03:00 committed by Warner Losh
parent cf9c4b32cc
commit ab08da5328

View File

@ -229,7 +229,7 @@ command_commandlist(int argc __unused, char *argv[] __unused)
{
struct bootblk_command **cmdp;
int res;
char name[20];
char name[23];
res = 0;
pager_open();
@ -238,9 +238,10 @@ command_commandlist(int argc __unused, char *argv[] __unused)
if (res)
break;
if ((*cmdp)->c_name != NULL && (*cmdp)->c_desc != NULL) {
snprintf(name, sizeof(name), " %-15s ",
snprintf(name, sizeof(name), " %-20s",
(*cmdp)->c_name);
pager_output(name);
pager_output(" ");
pager_output((*cmdp)->c_desc);
res = pager_output("\n");
}