git: ab08da5328b4 - main - loader: Increase buffer size to accommodate longer commands
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 28 Jun 2024 00:40:30 UTC
The branch main has been updated by imp:
URL: https://cgit.FreeBSD.org/src/commit/?id=ab08da5328b4175e399d8e59adc4dfad0eea24f1
commit ab08da5328b4175e399d8e59adc4dfad0eea24f1
Author: Ahmad Khalifa <ahmadkhalifa570@gmail.com>
AuthorDate: 2024-06-05 00:32:58 +0000
Commit: Warner Losh <imp@FreeBSD.org>
CommitDate: 2024-06-28 00:40:15 +0000
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
---
stand/common/commands.c | 5 +++--
1 file 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");
}