diff --git a/eeschema/class_libentry.cpp b/eeschema/class_libentry.cpp index 1d49ea3e42..cca83e4337 100644 --- a/eeschema/class_libentry.cpp +++ b/eeschema/class_libentry.cpp @@ -886,7 +886,7 @@ bool LIB_PART::Load( LINE_READER& aLineReader, wxString& aErrorMsg ) { p = strtok( line, " \t\n" ); - if( stricmp( p, "ENDDEF" ) == 0 ) + if( p && stricmp( p, "ENDDEF" ) == 0 ) break; } @@ -948,6 +948,9 @@ bool LIB_PART::Load( LINE_READER& aLineReader, wxString& aErrorMsg ) if( *line == '#' ) // a comment continue; + if( p == NULL ) // empty line + continue; + if( line[0] == 'T' && line[1] == 'i' ) result = LoadDateAndTime( aLineReader ); else if( *line == 'F' ) @@ -1036,7 +1039,12 @@ bool LIB_PART::LoadDrawEntries( LINE_READER& aLineReader, wxString& aErrorMsg ) break; case '#': // Comment - continue; + continue; + + case '\n': + case '\r': + case 0: // empty line + continue; default: aErrorMsg.Printf( wxT( "undefined DRAW command %c" ), line[0] );