(GX/PS3/PSP/XDK) Don't use strdup anymore for setting wrap arguments

This commit is contained in:
twinaphex 2014-06-13 18:11:08 +02:00
parent d1c7cd650f
commit f2e4625858
4 changed files with 12 additions and 8 deletions

View File

@ -200,7 +200,8 @@ static void frontend_gx_get_environment_settings(int *argc, char *argv[],
// needed on Wii; loaders follow a dumb standard where the path and filename are separate in the argument list
if (*argc > 2 && argv[1] != NULL && argv[2] != NULL)
{
char path[PATH_MAX];
static char path[PATH_MAX];
*path = '\0';
struct rarch_main_wrap *args = (struct rarch_main_wrap*)params_data;
if (args)
@ -213,7 +214,7 @@ static void frontend_gx_get_environment_settings(int *argc, char *argv[],
args->config_path = NULL;
args->sram_path = NULL;
args->state_path = NULL;
args->rom_path = strdup(path);
args->rom_path = path;
args->libretro_path = NULL;
}
}

View File

@ -122,7 +122,8 @@ static void frontend_ps3_get_environment_settings(int *argc, char *argv[],
#ifndef IS_SALAMANDER
if (*argc > 1 && argv[1] != NULL && argv[1][0] != '\0')
{
char path[PATH_MAX];
static char path[PATH_MAX];
*path = '\0';
struct rarch_main_wrap *args = (struct rarch_main_wrap*)params_data;
if (args)
@ -135,7 +136,7 @@ static void frontend_ps3_get_environment_settings(int *argc, char *argv[],
args->config_path = NULL;
args->sram_path = NULL;
args->state_path = NULL;
args->rom_path = strdup(path);
args->rom_path = path;
args->libretro_path = NULL;
RARCH_LOG("argv[0]: %s\n", argv[0]);

View File

@ -71,7 +71,8 @@ static void frontend_psp_get_environment_settings(int *argc, char *argv[],
if (argv[1] && (argv[1][0] != '\0'))
{
char path[PATH_MAX];
static char path[PATH_MAX];
*path = '\0';
struct rarch_main_wrap *args = (struct rarch_main_wrap*)params_data;
if (args)
@ -84,7 +85,7 @@ static void frontend_psp_get_environment_settings(int *argc, char *argv[],
args->config_path = NULL;
args->sram_path = NULL;
args->state_path = NULL;
args->rom_path = strdup(path);
args->rom_path = path;
args->libretro_path = NULL;
RARCH_LOG("argv[0]: %s\n", argv[0]);

View File

@ -156,7 +156,8 @@ static void frontend_xdk_get_environment_settings(int *argc, char *argv[],
#endif
#ifndef IS_SALAMANDER
char path[PATH_MAX];
static char path[PATH_MAX];
*path = '\0';
#if defined(_XBOX1)
RARCH_LOG("Gets here top.\n");
LAUNCH_DATA ptr;
@ -212,7 +213,7 @@ static void frontend_xdk_get_environment_settings(int *argc, char *argv[],
args->config_path = NULL;
args->sram_path = NULL;
args->state_path = NULL;
args->rom_path = strdup(path);
args->rom_path = path;
args->libretro_path = NULL;
RARCH_LOG("Auto-start game %s.\n", path);