X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/cb820f807532f2de04389756ba94f762395245ea..ffafd8a55bb0b8fb4236e4522792a6b143813609:/src/common/fileconf.cpp diff --git a/src/common/fileconf.cpp b/src/common/fileconf.cpp index 6423bbe8e9..071b90f243 100644 --- a/src/common/fileconf.cpp +++ b/src/common/fileconf.cpp @@ -494,10 +494,21 @@ wxFileConfig::wxFileConfig(wxInputStream &inStream, wxMBConv& conv) wxString strTmp; char buf[1024]; - while ( !inStream.Read(buf, WXSIZEOF(buf)).Eof() ) - strTmp.append(wxConvertMB2WX(buf), inStream.LastRead()); + do + { + inStream.Read(buf, WXSIZEOF(buf)); + + const wxStreamError err = inStream.GetLastError(); + + if ( err != wxSTREAM_NO_ERROR && err != wxSTREAM_EOF ) + { + wxLogError(_("Error reading config options.")); + break; + } - strTmp.append(wxConvertMB2WX(buf), inStream.LastRead()); + strTmp.append(wxConvertMB2WX(buf), inStream.LastRead()); + } + while ( !inStream.Eof() ); strTrans = wxTextBuffer::Translate(strTmp); }