diff --git a/cvpcb/cvpcb_mainframe.cpp b/cvpcb/cvpcb_mainframe.cpp index 37211bbd48..81b80c7b47 100644 --- a/cvpcb/cvpcb_mainframe.cpp +++ b/cvpcb/cvpcb_mainframe.cpp @@ -911,7 +911,9 @@ void CVPCB_MAINFRAME::SendComponentSelectionToSch( bool aClearSelectionOnly ) // Now select the corresponding symbol on the schematic: wxString ref = m_netlist.GetComponent( selection )->GetReference(); - command += wxT( "F" ) + EscapeString( ref, CTX_IPC ); + // The prefix 0,F before the reference is for selecting the symbol + // (one can select a pin with a different prefix) + command += wxT( "0,F" ) + EscapeString( ref, CTX_IPC ); if( Kiface().IsSingle() ) SendCommand( MSG_TO_SCH, command ); diff --git a/eeschema/cross-probing.cpp b/eeschema/cross-probing.cpp index 27269e015c..621858bb40 100644 --- a/eeschema/cross-probing.cpp +++ b/eeschema/cross-probing.cpp @@ -840,6 +840,10 @@ void SCH_EDIT_FRAME::KiwayMailIn( KIWAY_EXPRESS& mail ) std::string prefix = "$SELECT: "; std::string paramStr = payload.substr( prefix.size() ); + + if( paramStr.size() < 2 ) // Empty/broken command: we need at least 2 chars for sync string. + break; + std::string syncStr = paramStr.substr( 2 ); bool focusOnFirst = ( paramStr[0] == '1' );