Use Glib::KeyFile::load_from_file in ProcParams::load instead of reading into a temporary buffer

Fixes #4205
This commit is contained in:
Alberto Griggio 2017-12-04 22:44:25 +01:00
parent 4f9d272c94
commit d78848c614

View File

@ -3743,29 +3743,10 @@ int ProcParams::load (const Glib::ustring &fname, ParamsEdited* pedited)
pedited->set (false); pedited->set (false);
} }
FILE* f = g_fopen (fname.c_str (), "rt"); if (!keyFile.load_from_file(fname)) {
if (!f) {
return 1; return 1;
} }
char* buffer = new char[1024];
std::ostringstream ostr;
while (fgets (buffer, 1024, f)) {
ostr << buffer << "\n";
}
delete [] buffer;
if (!keyFile.load_from_data (ostr.str())) {
return 1;
}
fclose (f);
// load tonecurve:
ppVersion = PPVERSION; ppVersion = PPVERSION;
appVersion = APPVERSION; appVersion = APPVERSION;