Fix coverity error
Check failed to open file before dereferencing
This commit is contained in:
parent
38e1e780a8
commit
754464cb3b
|
@ -2329,13 +2329,14 @@ XNODE* CADSTAR_ARCHIVE_PARSER::LoadArchiveFile( const wxString& aFileName,
|
|||
|
||||
// Open the file and get the file size
|
||||
FILE* fp = wxFopen( aFileName, wxT( "rt" ) );
|
||||
fseek( fp, 0L, SEEK_END );
|
||||
long fileSize = ftell( fp );
|
||||
rewind( fp );
|
||||
|
||||
if( !fp )
|
||||
THROW_IO_ERROR( wxString::Format( _( "Cannot open file '%s'" ), aFileName ) );
|
||||
|
||||
fseek( fp, 0L, SEEK_END );
|
||||
long fileSize = ftell( fp );
|
||||
rewind( fp );
|
||||
|
||||
DSNLEXER lexer( emptyKeywords, 0, fp, aFileName );
|
||||
|
||||
long currentPosition = 0;
|
||||
|
|
Loading…
Reference in New Issue