From 62d68b33c314edf49a4bf017cf109461930a3561 Mon Sep 17 00:00:00 2001 From: CTCaer Date: Sun, 8 May 2022 05:59:57 +0300 Subject: [PATCH] nyx: tools: use actual gpt entries num in part manager --- nyx/nyx_gui/frontend/gui_tools_partition_manager.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nyx/nyx_gui/frontend/gui_tools_partition_manager.c b/nyx/nyx_gui/frontend/gui_tools_partition_manager.c index 5763921..f71d437 100644 --- a/nyx/nyx_gui/frontend/gui_tools_partition_manager.c +++ b/nyx/nyx_gui/frontend/gui_tools_partition_manager.c @@ -451,8 +451,8 @@ static void _prepare_and_flash_mbr_gpt() } // Set final GPT header parameters. - gpt->header.num_part_ents = 128; - gpt->header.part_ents_crc32 = crc32_calc(0, (const u8 *)gpt->entries, sizeof(gpt_entry_t) * 128); + gpt->header.num_part_ents = gpt_idx; + gpt->header.part_ents_crc32 = crc32_calc(0, (const u8 *)gpt->entries, sizeof(gpt_entry_t) * gpt->header.num_part_ents); gpt->header.crc32 = 0; // Set to 0 for calculation. gpt->header.crc32 = crc32_calc(0, (const u8 *)&gpt->header, gpt->header.size);