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 <johan.hedberg@intel.com>
This commit is contained in:
Johan Hedberg 2023-11-05 21:03:17 +02:00 committed by Carles Cufí
parent 584a1cf0fc
commit 6e8a1f5859

View File

@ -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);