From 35a3d4ba730724acf775f181952e5a41ecf6fc12 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 16 Jul 2019 19:32:27 +0200 Subject: [PATCH] (task_overlay) Use config_file_from_string --- tasks/task_overlay.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tasks/task_overlay.c b/tasks/task_overlay.c index 860cbf0de9..251c0c13d5 100644 --- a/tasks/task_overlay.c +++ b/tasks/task_overlay.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -734,6 +735,8 @@ bool task_push_overlay_load_default( void *user_data) { task_finder_data_t find_data; + int64_t length = 0; + uint8_t *ret_buf = NULL; retro_task_t *t = NULL; config_file_t *conf = NULL; overlay_loader_t *loader = NULL; @@ -753,7 +756,12 @@ bool task_push_overlay_load_default( if (!loader) return false; - conf = config_file_new(overlay_path); + if (filestream_read_file(overlay_path, (void**)&ret_buf, &length)) + { + if (length >= 0) + conf = config_file_new_from_string((const char*)ret_buf); + free((void*)ret_buf); + } if (!conf) { @@ -761,6 +769,8 @@ bool task_push_overlay_load_default( return false; } + conf->path = strdup(overlay_path); + if (!config_get_uint(conf, "overlays", &loader->size)) { /* Error - overlays varaible not defined in config. */