From fe8491348fc1379a2d2f5a2219b5e18e47e5e557 Mon Sep 17 00:00:00 2001 From: CorpNewt <12772521+corpnewt@users.noreply.github.com> Date: Thu, 9 Mar 2023 14:12:49 -0600 Subject: [PATCH] OcAcpiLib: Fix comment printing failing to process long comments (#432) --- Library/OcMainLib/OpenCoreAcpi.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Library/OcMainLib/OpenCoreAcpi.c b/Library/OcMainLib/OpenCoreAcpi.c index 181ec2c0..254dff79 100644 --- a/Library/OcMainLib/OpenCoreAcpi.c +++ b/Library/OcMainLib/OpenCoreAcpi.c @@ -140,6 +140,7 @@ OcAcpiPatchTables ( EFI_STATUS Status; UINT32 Index; OC_ACPI_PATCH_ENTRY *UserPatch; + CONST CHAR8 *Comment; OC_ACPI_PATCH Patch; for (Index = 0; Index < Config->Acpi.Patch.Count; ++Index) { @@ -149,6 +150,8 @@ OcAcpiPatchTables ( continue; } + Comment = OC_BLOB_GET (&UserPatch->Comment); + // // Ignore patch if: // - There is nothing to replace. @@ -161,7 +164,7 @@ OcAcpiPatchTables ( || ((UserPatch->Mask.Size > 0) && (UserPatch->Find.Size != UserPatch->Mask.Size)) || ((UserPatch->ReplaceMask.Size > 0) && (UserPatch->Replace.Size != UserPatch->ReplaceMask.Size))) { - DEBUG ((DEBUG_ERROR, "OC: ACPI patch (%a) at %u is borked\n", UserPatch->Comment, Index)); + DEBUG ((DEBUG_ERROR, "OC: ACPI patch (%a) at %u is borked\n", Comment, Index)); continue; } @@ -192,7 +195,7 @@ OcAcpiPatchTables ( DEBUG_INFO, "OC: Applying %u byte ACPI patch (%a) at %u, skip %u, count %u\n", Patch.Size, - UserPatch->Comment, + Comment, Index, Patch.Skip, Patch.Count @@ -200,7 +203,7 @@ OcAcpiPatchTables ( Status = AcpiApplyPatch (Context, &Patch); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_WARN, "OC: ACPI patcher failed (%a) at %u - %r\n", UserPatch->Comment, Index, Status)); + DEBUG ((DEBUG_WARN, "OC: ACPI patcher failed (%a) at %u - %r\n", Comment, Index, Status)); } } } -- GitLab