diff --git a/eeschema/tools/symbol_editor_edit_tool.cpp b/eeschema/tools/symbol_editor_edit_tool.cpp index c8841533ed..e0f81c08ca 100644 --- a/eeschema/tools/symbol_editor_edit_tool.cpp +++ b/eeschema/tools/symbol_editor_edit_tool.cpp @@ -275,7 +275,7 @@ int SYMBOL_EDITOR_EDIT_TOOL::DoDelete( const TOOL_EVENT& aEvent ) // in different units are also removed. But only one pin per unit (matching) if( m_frame->SynchronizePins() ) { - std::vector got_unit( symbol->GetUnitCount() ); + std::vector got_unit( symbol->GetUnitCount() + 1 ); got_unit[pin->GetUnit()] = true; diff --git a/eeschema/tools/symbol_editor_move_tool.cpp b/eeschema/tools/symbol_editor_move_tool.cpp index 0898e1e0ae..20caf6a45b 100644 --- a/eeschema/tools/symbol_editor_move_tool.cpp +++ b/eeschema/tools/symbol_editor_move_tool.cpp @@ -156,7 +156,7 @@ int SYMBOL_EDITOR_MOVE_TOOL::Main( const TOOL_EVENT& aEvent ) { LIB_PIN* cur_pin = static_cast( lib_item ); LIB_SYMBOL* symbol = m_frame->GetCurSymbol(); - std::vector got_unit( symbol->GetUnitCount() ); + std::vector got_unit( symbol->GetUnitCount() + 1 ); got_unit[cur_pin->GetUnit()] = true; diff --git a/eeschema/tools/symbol_editor_pin_tool.cpp b/eeschema/tools/symbol_editor_pin_tool.cpp index 38c47715eb..cfc18f7911 100644 --- a/eeschema/tools/symbol_editor_pin_tool.cpp +++ b/eeschema/tools/symbol_editor_pin_tool.cpp @@ -142,7 +142,7 @@ bool SYMBOL_EDITOR_PIN_TOOL::EditPinProperties( LIB_PIN* aPin ) // a pin can have a unit id = 0 (common to all units) to unit count // So we need a buffer size = GetUnitCount()+1 to store a value in a vector // when using the unit id of a pin as index - std::vector got_unit( aPin->GetParent()->GetUnitCount()+1 ); + std::vector got_unit( aPin->GetParent()->GetUnitCount() + 1 ); got_unit[static_cast(aPin->GetUnit())] = true;