diff --git a/src/common/fileconf.cpp b/src/common/fileconf.cpp index 6423bbe8e9..1c0337284e 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() ) + for ( ;; ) + { + inStream.Read(buf, WXSIZEOF(buf)); + + if ( !inStream.IsOk() ) + { + wxLogError(_("Error reading config options.")); + break; + } + strTmp.append(wxConvertMB2WX(buf), inStream.LastRead()); - strTmp.append(wxConvertMB2WX(buf), inStream.LastRead()); + if ( inStream.Eof() ) + break; + } strTrans = wxTextBuffer::Translate(strTmp); }