Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/cleditor/STEPfile.cc
Original file line number Diff line number Diff line change
Expand Up @@ -743,6 +743,15 @@ int STEPfile::FindHeaderSection( istream & in ) {
return 0;
}
in.getline( buf, BUFSIZ, ';' ); // reads but does not store the ;
if( in.fail() ) {
// A file with no ';' in its first BUFSIZ bytes - a binary file that
// is not STEP at all, say - sets failbit and leaves buf unchanged.
// eof() then never becomes true and the loop above spins forever.
_error.AppendToUserMsg(
"Error: Unable to find HEADER section. File not read.\n" );
_error.GreaterSeverity( SEVERITY_INPUT_ERROR );
return 0;
}
}
return 1;
}
Expand Down
Loading