diff --git a/configuration.c b/configuration.c index 7bdc9dca92..6ae6cee864 100644 --- a/configuration.c +++ b/configuration.c @@ -3656,20 +3656,23 @@ bool config_load_override(void *data) { char temp_path[PATH_MAX_LENGTH]; - temp_path[0] = '\0'; - RARCH_LOG("[Overrides]: Content dir-specific overrides found at \"%s\".\n", content_path); if (should_append) { RARCH_LOG("[Overrides]: Content dir-specific overrides stacking on top of previous overrides.\n"); - strlcpy(temp_path, path_get(RARCH_PATH_CONFIG_APPEND), sizeof(temp_path)); - strlcat(temp_path, "|", sizeof(temp_path)); - strlcat(temp_path, content_path, sizeof(temp_path)); + snprintf(temp_path, sizeof(temp_path), + "%s|%s", + path_get(RARCH_PATH_CONFIG_APPEND), + content_path + ); } else + { + temp_path[0] = '\0'; strlcpy(temp_path, content_path, sizeof(temp_path)); + } path_set(RARCH_PATH_CONFIG_APPEND, temp_path); @@ -3685,20 +3688,23 @@ bool config_load_override(void *data) { char temp_path[PATH_MAX_LENGTH]; - temp_path[0] = '\0'; - RARCH_LOG("[Overrides]: Game-specific overrides found at \"%s\".\n", game_path); if (should_append) { RARCH_LOG("[Overrides]: Game-specific overrides stacking on top of previous overrides.\n"); - strlcpy(temp_path, path_get(RARCH_PATH_CONFIG_APPEND), sizeof(temp_path)); - strlcat(temp_path, "|", sizeof(temp_path)); - strlcat(temp_path, game_path, sizeof(temp_path)); + snprintf(temp_path, sizeof(temp_path), + "%s|%s", + path_get(RARCH_PATH_CONFIG_APPEND), + game_path + ); } else + { + temp_path[0] = '\0'; strlcpy(temp_path, game_path, sizeof(temp_path)); + } path_set(RARCH_PATH_CONFIG_APPEND, temp_path); diff --git a/core_info.c b/core_info.c index c0a11a2875..3a60eff22a 100644 --- a/core_info.c +++ b/core_info.c @@ -1490,15 +1490,16 @@ static config_file_t *core_info_get_config_file( { char info_path[PATH_MAX_LENGTH]; - info_path[0] = '\0'; - if (string_is_empty(info_dir)) - strlcpy(info_path, core_file_id, sizeof(info_path)); + snprintf(info_path, sizeof(info_path), + "%s" ".info", core_file_id); else + { + info_path[0] = '\0'; fill_pathname_join(info_path, info_dir, core_file_id, sizeof(info_path)); - - strlcat(info_path, ".info", sizeof(info_path)); + strlcat(info_path, ".info", sizeof(info_path)); + } return config_file_new_from_path_to_string(info_path); }