From 6e8a1f5859c85e62c6325d3ecb1cf2c61a42a2bf Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Sun, 5 Nov 2023 21:03:17 +0200 Subject: [PATCH] acpi: shell: Fix specifying string precision The ACPI table signature is not null terminated, so a precision needs to be provided in format strings. There was an attempt to do this, but it was done in an incorrect way, which resulted in garbage characters getting printed. Signed-off-by: Johan Hedberg --- lib/acpi/acpi_shell.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/acpi/acpi_shell.c b/lib/acpi/acpi_shell.c index ef940e478b3..e2db3aaa30e 100644 --- a/lib/acpi/acpi_shell.c +++ b/lib/acpi/acpi_shell.c @@ -252,7 +252,7 @@ static int read_table(const struct shell *sh, size_t argc, char **argv) } shell_print(sh, "ACPI Table %s:", argv[1]); - shell_print(sh, "\tSignature: %4s", table->Signature); + shell_print(sh, "\tSignature: %.4s", table->Signature); shell_print(sh, "\tTable Length: %d", table->Length); shell_print(sh, "\tRevision: %d", table->Revision); shell_print(sh, "\tOemId: %s", table->OemId);