From 8c8ebf2edac36e1d10c6b17a6a6732dd3733c454 Mon Sep 17 00:00:00 2001 From: pineappleEA Date: Thu, 23 Nov 2023 20:55:10 +0100 Subject: [PATCH] early-access version 3988 --- README.md | 2 +- src/frontend_common/config.cpp | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 356859708..875343d8d 100755 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ yuzu emulator early access ============= -This is the source code for early-access 3987. +This is the source code for early-access 3988. ## Legal Notice diff --git a/src/frontend_common/config.cpp b/src/frontend_common/config.cpp index a68a9cb4b..7474cb0f9 100755 --- a/src/frontend_common/config.cpp +++ b/src/frontend_common/config.cpp @@ -65,6 +65,11 @@ void Config::WriteToIni() const { fp = fopen(config_loc.c_str(), "wb"); #endif + if (fp == nullptr) { + LOG_ERROR(Frontend, "Config file could not be saved!"); + return; + } + CSimpleIniA::FileWriter writer(fp); const SI_Error rc = config->Save(writer, false); if (rc < 0) { @@ -91,6 +96,11 @@ void Config::SetUpIni() { } #endif + if (fp == nullptr) { + LOG_ERROR(Frontend, "Config file could not be loaded!"); + return; + } + if (SI_Error rc = config->LoadFile(fp); rc < 0) { LOG_ERROR(Frontend, "Config file could not be loaded!"); } @@ -332,8 +342,7 @@ void Config::ReadScreenshotValues() { ReadCategory(Settings::Category::Screenshots); FS::SetYuzuPath(FS::YuzuPath::ScreenshotsDir, - ReadStringSetting(std::string("screenshot_path"), - FS::GetYuzuPathString(FS::YuzuPath::ScreenshotsDir))); + ReadStringSetting(std::string("screenshot_path"))); EndGroup(); }