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)