From 9bff739de1800180f5c7cd37da94ecf223231732 Mon Sep 17 00:00:00 2001 From: mintsuki Date: Sat, 26 Dec 2020 20:38:30 +0100 Subject: [PATCH] limine-install/gpt: Fix broken comparison of partition count and print out partition count when embedding --- limine-install.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/limine-install.c b/limine-install.c index f7511d8f..d79bbfd4 100644 --- a/limine-install.c +++ b/limine-install.c @@ -236,11 +236,13 @@ int main(int argc, char *argv[]) { size_t new_partition_entry_count = new_partition_array_lba_size * partition_entries_per_lb; - if ((ssize_t)new_partition_array_lba_size <= max_partition_entry_used) { + if ((ssize_t)new_partition_entry_count <= max_partition_entry_used) { fprintf(stderr, "error: Cannot embed because there are too many used partition entries.\n"); goto cleanup; } + fprintf(stderr, "New maximum count of partition entries: %zu.\n", new_partition_entry_count); + uint8_t *partition_array = malloc(new_partition_entry_count * gpt_header.size_of_partition_entry); if (partition_array == NULL) {