Use tmp_str variable for config_get_path usage

This commit is contained in:
twinaphex 2016-06-25 07:17:48 +02:00
parent c6e835685f
commit 49e8baa61d
2 changed files with 12 additions and 6 deletions

View File

@ -133,17 +133,19 @@ static bool video_shader_parse_pass(config_file_t *conf,
char frame_count_mod[64] = {0};
struct gfx_fbo_scale *scale = NULL;
bool tmp_bool = false;
char tmp_str[PATH_MAX_LENGTH]= {0};
float fattr = 0.0f;
int iattr = 0;
/* Source */
snprintf(shader_name, sizeof(shader_name), "shader%u", i);
if (!config_get_path(conf, shader_name,
pass->source.path, sizeof(pass->source.path)))
if (!config_get_path(conf, shader_name, tmp_str, sizeof(tmp_str)))
{
RARCH_ERR("Couldn't parse shader source (%s).\n", shader_name);
return false;
}
strlcpy(pass->source.path, tmp_str, sizeof(pass->source.path));
/* Smooth */
snprintf(filter_name_buf, sizeof(filter_name_buf), "filter_linear%u", i);
@ -492,6 +494,7 @@ static bool video_shader_parse_imports(config_file_t *conf,
const char *id = NULL;
char *save = NULL;
char imports[1024] = {0};
char tmp_str[PATH_MAX_LENGTH]= {0};
if (!config_get_array(conf, "imports", imports, sizeof(imports)))
return true;
@ -594,8 +597,8 @@ static bool video_shader_parse_imports(config_file_t *conf,
var->equal = equal;
}
config_get_path(conf, "import_script",
shader->script_path, sizeof(shader->script_path));
if (config_get_path(conf, "import_script", tmp_str, sizeof(tmp_str)))
strlcpy(shader->script_path, tmp_str, sizeof(shader->script_path));
config_get_array(conf, "import_script_class",
shader->script_class, sizeof(shader->script_class));

View File

@ -391,6 +391,7 @@ static void task_overlay_deferred_load(retro_task_t *task)
struct texture_image *texture_img = NULL;
struct overlay_desc *overlay_desc = NULL;
struct overlay *overlay = NULL;
char tmp_str[PATH_MAX_LENGTH] = {0};
bool to_cont = loader->pos < loader->size;
if (!to_cont)
@ -463,8 +464,10 @@ static void task_overlay_deferred_load(retro_task_t *task)
snprintf(overlay->config.paths.key, sizeof(overlay->config.paths.key),
"overlay%u_overlay", loader->pos);
config_get_path(conf, overlay->config.paths.key,
overlay->config.paths.path, sizeof(overlay->config.paths.path));
if (config_get_path(conf, overlay->config.paths.key,
tmp_str, sizeof(tmp_str)))
strlcpy(overlay->config.paths.path,
tmp_str, sizeof(overlay->config.paths.path));
if (!string_is_empty(overlay->config.paths.path))
{