From ffd0b5df6ae7efbbdf9a59f3c04d2d9cadca7e3a Mon Sep 17 00:00:00 2001 From: TuxSH Date: Mon, 21 May 2018 17:45:05 +0200 Subject: [PATCH] Fix bug in stratosphere_get_ini1, etc. --- fusee/fusee-secondary/src/stratosphere.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/fusee/fusee-secondary/src/stratosphere.c b/fusee/fusee-secondary/src/stratosphere.c index c27d55bdb..63a3e4f52 100644 --- a/fusee/fusee-secondary/src/stratosphere.c +++ b/fusee/fusee-secondary/src/stratosphere.c @@ -46,7 +46,7 @@ ini1_header_t *stratosphere_get_ini1(uint32_t target_firmware) { size_t size = sizeof(ini1_header_t) + loader_kip_size + pm_kip_size + sm_kip_size + boot_kip_size; g_stratosphere_ini1 = (ini1_header_t *)malloc(size); - if (g_stratosphere_ini1 != NULL) { + if (g_stratosphere_ini1 == NULL) { fatal_error("stratosphere_get_ini1: out of memory!\n"); } @@ -145,9 +145,8 @@ ini1_header_t *stratosphere_merge_inis(ini1_header_t **inis, size_t num_inis) { } size_t expected_sd_kip_size = kip1_get_size_from_header(sd_kip); if (expected_sd_kip_size != read_size) { - printf("Error: %s has wrong size or there is not enough space (expected 0x%zx, read 0x%zx)!\n", + fatal_error("%s has wrong size or there is not enough space (expected 0x%zx, read 0x%zx)!\n", sd_path, expected_sd_kip_size, read_size); - generic_panic(); } remaining_size -= expected_sd_kip_size; current_dst_kip += expected_sd_kip_size;