Skip to content

Commit 1a26526

Browse files
author
Nicholas Reed
committed
better error printing; SCL git 99abb18 and 6b95067
1 parent ed115dd commit 1a26526

2 files changed

Lines changed: 13 additions & 9 deletions

File tree

src/clstepcore/STEPattribute.cc

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,6 @@ Severity STEPattribute::StrToVal( const char * s, InstMgr * instances, int addFi
196196
******************************************************************/
197197
Severity STEPattribute::STEPread( istream & in, InstMgr * instances, int addFileId,
198198
const char * currSch ) {
199-
char errStr[BUFSIZ];
200-
errStr[0] = '\0';
201199
char c = '\0';
202200

203201
// The attribute has been redefined by the attribute pointed
@@ -221,10 +219,11 @@ Severity STEPattribute::STEPread( istream & in, InstMgr * instances, int addFile
221219
_error.severity( SEVERITY_NULL );
222220
} else {
223221
_error.severity( SEVERITY_WARNING );
224-
sprintf( errStr, " WARNING: attribute %s of type %s, %s",
225-
aDesc->Name(), aDesc->TypeName(),
226-
"Missing asterisk for derived attribute.\n" );
227-
_error.AppendToDetailMsg( errStr );
222+
_error.AppendToDetailMsg( " WARNING: attribute " );
223+
_error.AppendToDetailMsg( aDesc->Name() );
224+
_error.AppendToDetailMsg( " of type " );
225+
_error.AppendToDetailMsg( aDesc->TypeName() );
226+
_error.AppendToDetailMsg( "Missing asterisk for derived attribute.\n" );
228227
}
229228
CheckRemainingInput( in, &_error, aDesc->TypeName(), ",)" );
230229
return _error.severity();
@@ -243,8 +242,7 @@ Severity STEPattribute::STEPread( istream & in, InstMgr * instances, int addFile
243242
_error.severity( SEVERITY_NULL );
244243
} else {
245244
_error.severity( SEVERITY_INCOMPLETE );
246-
sprintf( errStr, " missing and required\n" );
247-
_error.AppendToDetailMsg( errStr );
245+
_error.AppendToDetailMsg( " missing and required\n" );
248246
}
249247
return _error.severity();
250248
}

src/clstepcore/STEPcomplex.cc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,13 @@ STEPcomplex::BuildAttrs( const char * s ) {
525525

526526
void
527527
STEPcomplex::STEPread_error( char c, int index, istream & in ) {
528-
cout << "STEPcomplex::STEPread_error() \n";
528+
cout << "STEPcomplex::STEPread_error(), index=" << index << ", entity #" << STEPfile_id << "." << endl;
529+
streampos p = in.tellg();
530+
std::string q, r;
531+
getline( in, q );
532+
getline( in, r );
533+
cout << "Remainder of this line:" << endl << c << q << endl << "Next line:" << endl << r << endl;
534+
in.seekg( p );
529535
}
530536

531537
// WRITE

0 commit comments

Comments
 (0)