From 4f4c3e636660375ce4cd12d609915efedfd78eb5 Mon Sep 17 00:00:00 2001 From: akallabeth Date: Mon, 26 May 2025 18:10:21 +0200 Subject: [PATCH] [client,sdl] use new JSON config reader --- client/SDL/common/sdl_prefs.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/client/SDL/common/sdl_prefs.cpp b/client/SDL/common/sdl_prefs.cpp index a08ddc6bb..30cbf3059 100644 --- a/client/SDL/common/sdl_prefs.cpp +++ b/client/SDL/common/sdl_prefs.cpp @@ -41,10 +41,7 @@ namespace fs = std::experimental::filesystem; SdlPref::WINPR_JSONPtr SdlPref::get() { auto config = get_pref_file(); - - std::ifstream ifs(config); - std::string content((std::istreambuf_iterator(ifs)), (std::istreambuf_iterator())); - return { WINPR_JSON_ParseWithLength(content.c_str(), content.size()), WINPR_JSON_Delete }; + return { WINPR_JSON_ParseFromFile(config.c_str()), WINPR_JSON_Delete }; } WINPR_JSON* SdlPref::get_item(const std::string& key)