From 4b182446e97437add16fc10a7fe4768857d3a356 Mon Sep 17 00:00:00 2001 From: Autechre Date: Sat, 7 Nov 2020 10:01:56 +0100 Subject: [PATCH] Revert "VITA: fix crash when started with missing boot params" --- frontend/drivers/platform_psp.c | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/frontend/drivers/platform_psp.c b/frontend/drivers/platform_psp.c index 8fb55ec2f9..df6d109ffb 100644 --- a/frontend/drivers/platform_psp.c +++ b/frontend/drivers/platform_psp.c @@ -342,30 +342,25 @@ static void frontend_psp_exec(const char *path, bool should_load_game) RARCH_LOG("Attempt to load executable: [%s].\n", path); #if defined(VITA) RARCH_LOG("Attempt to load executable: %d [%s].\n", args, argp); - int ret; #ifdef IS_SALAMANDER sceAppMgrGetAppParam(boot_params); if (strstr(boot_params,"psgm:play")) { - char *param1 = strstr(boot_params, "¶m="); + int ret; + char *param1 = strstr(boot_params, "¶m=")+7; char *param2 = strstr(boot_params, "¶m2="); - if (param1 != NULL && param2 != NULL) - { - param1 += 7; - memcpy(core_name, param1, param2 - param1); - core_name[param2-param1] = 0; - sprintf(argp, param2 + 8); - ret = sceAppMgrLoadExec(core_name, (char * const*)((const char*[]){argp, 0}), NULL); - RARCH_LOG("Attempt to load executable: [%d].\n", ret); - goto exit; - } - RARCH_LOG("Required boot params missing. Continue nornal boot."); + memcpy(core_name, param1, param2 - param1); + core_name[param2-param1] = 0; + sprintf(argp, param2 + 8); + ret = sceAppMgrLoadExec(core_name, (char * const*)((const char*[]){argp, 0}), NULL); + RARCH_LOG("Attempt to load executable: [%d].\n", ret); } + else #endif - ret = sceAppMgrLoadExec(path, args == 0 ? NULL : (char * const*)((const char*[]){argp, 0}), NULL); - RARCH_LOG("Attempt to load executable: [%d].\n", ret); - -exit: + { + int ret = sceAppMgrLoadExec(path, args == 0 ? NULL : (char * const*)((const char*[]){argp, 0}), NULL); + RARCH_LOG("Attempt to load executable: [%d].\n", ret); + } #else exitspawn_kernel(path, args, argp); #endif