diff --git a/gfx/video_shader_parse.c b/gfx/video_shader_parse.c index 704582791a..2afb32bec1 100644 --- a/gfx/video_shader_parse.c +++ b/gfx/video_shader_parse.c @@ -2328,7 +2328,9 @@ bool video_shader_load_preset_into_shader(const char *path, #endif /* Gather all the paths of all of the presets in all reference chains */ - override_paths_list = path_linked_list_new(); + override_paths_list = (struct path_linked_list*)malloc(sizeof(*override_paths_list)); + override_paths_list->next = NULL; + override_paths_list->path = NULL; video_shader_gather_reference_path_list(override_paths_list, conf->path, 0); /* diff --git a/libretro-common/file/config_file.c b/libretro-common/file/config_file.c index 1edbc2aef4..2121977da4 100644 --- a/libretro-common/file/config_file.c +++ b/libretro-common/file/config_file.c @@ -413,7 +413,11 @@ size_t config_file_add_reference(config_file_t *conf, char *path) /* It is expected that the conf has it's path already set */ char short_path[NAME_MAX_LENGTH]; if (!conf->references) - conf->references = path_linked_list_new(); + { + conf->references = (struct path_linked_list*)malloc(sizeof(*conf->references)); + conf->references->next = NULL; + conf->references->path = NULL; + } len = fill_pathname_abbreviated_or_relative(short_path, conf->path, path, sizeof(short_path)); path_linked_list_add_path(conf->references, short_path); return len; diff --git a/libretro-common/file/file_path.c b/libretro-common/file/file_path.c index 9020444920..b8d4b4b4bb 100644 --- a/libretro-common/file/file_path.c +++ b/libretro-common/file/file_path.c @@ -358,7 +358,8 @@ char *find_last_slash(const char *str) { const char *slash = strrchr(str, '/'); const char *backslash = strrchr(str, '\\'); - return (!slash || (backslash > slash)) ? (char*)backslash : (char*)slash; + char *last_slash = (!slash || (backslash > slash)) ? (char*)backslash : (char*)slash; + return last_slash; } /** @@ -374,7 +375,7 @@ size_t fill_pathname_slash(char *path, size_t size) size_t path_len; const char *slash = strrchr(path, '/'); const char *backslash = strrchr(path, '\\'); - const char *last_slash = (!slash || (backslash > slash)) ? (char*)backslash : (char*)slash; + char *last_slash = (!slash || (backslash > slash)) ? (char*)backslash : (char*)slash; if (!last_slash) return strlcat(path, PATH_DEFAULT_SLASH(), size); path_len = strlen(path);