diff options
author | Ahmad Khalifa <ahmadkhalifa570@gmail.com> | 2024-06-05 00:32:58 +0000 |
---|---|---|
committer | Warner Losh <imp@FreeBSD.org> | 2024-06-28 00:40:15 +0000 |
commit | ab08da5328b4175e399d8e59adc4dfad0eea24f1 (patch) | |
tree | 4d99d339f59a532fb8cb332c2b7e9064fad44f94 /stand/common | |
parent | cf9c4b32cca0550da1da9658bf13015d3105d2a9 (diff) |
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
Diffstat (limited to 'stand/common')
-rw-r--r-- | stand/common/commands.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/stand/common/commands.c b/stand/common/commands.c index e6e4fd005f72..95d12ad95973 100644 --- a/stand/common/commands.c +++ b/stand/common/commands.c @@ -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"); } |