Use Glib::KeyFile::load_from_file in ProcParams::load instead of reading into a temporary buffer
Fixes #4205
This commit is contained in:
parent
4f9d272c94
commit
d78848c614
@ -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;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user