From 70098677bfea0d66c883adf5b1079a2afdeb6594 Mon Sep 17 00:00:00 2001 From: vit9696 <4348897+vit9696@users.noreply.github.com> Date: Tue, 11 Jun 2019 00:04:20 +0300 Subject: [PATCH] OpenCoreMisc: Fix parsing Enabled in Tools section --- Platform/OpenCore/OpenCoreMisc.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/Platform/OpenCore/OpenCoreMisc.c b/Platform/OpenCore/OpenCoreMisc.c index b7b41561..c3a1d7fc 100644 --- a/Platform/OpenCore/OpenCoreMisc.c +++ b/Platform/OpenCore/OpenCoreMisc.c @@ -322,7 +322,7 @@ OcMiscBoot ( OC_PICKER_CONTEXT *Context; UINTN ContextSize; UINT32 Index; - UINT32 ToolCount; + UINT32 ToolIndex; // // Do not use our boot picker unless asked. @@ -358,17 +358,15 @@ OcMiscBoot ( Context->CustomEntryContext = Storage; Context->CustomRead = OcToolLoadEntry; - ToolCount = 0; - - for (Index = 0; Index < Context->CustomEntryCount; ++Index) { + for (Index = 0, ToolIndex = 0; Index < Config->Misc.Tools.Count; ++Index) { if (Config->Misc.Tools.Values[Index]->Enabled) { - Context->CustomEntries[Index].Name = OC_BLOB_GET (&Config->Misc.Tools.Values[Index]->Name); - Context->CustomEntries[Index].Path = OC_BLOB_GET (&Config->Misc.Tools.Values[Index]->Path); - ++ToolCount; + Context->CustomEntries[ToolIndex].Name = OC_BLOB_GET (&Config->Misc.Tools.Values[Index]->Name); + Context->CustomEntries[ToolIndex].Path = OC_BLOB_GET (&Config->Misc.Tools.Values[Index]->Path); + ++ToolIndex; } } - Context->CustomEntryCount = ToolCount; + Context->CustomEntryCount = ToolIndex; Status = OcRunSimpleBootPicker ( Context