Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
44e588dc
Commit
44e588dc
authored
Oct 26, 2009
by
stambaughw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bug in LocatePinByNumber that could cause EESchema to crash.
parent
0a75c624
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
16 deletions
+13
-16
locate.cpp
eeschema/locate.cpp
+13
-16
No files found.
eeschema/locate.cpp
View file @
44e588dc
...
...
@@ -615,16 +615,18 @@ static bool IsBox1InBox2( int StartX1, int StartY1, int EndX1, int EndY1,
/**
* Find a PIN in a component
* @param pin_number = pin number (string)
* @param pin_number = pin number (string)
* @return a pointer on the pin, or NULL if not found
* Find a PIN in a component by pin number.
*
* @param ePin_Number - pin number to locate.
* @param eComponent - schematic component object to search.
*
* @return a pointer to the located the pin, or NULL if not found
*/
LIB_PIN
*
LocatePinByNumber
(
const
wxString
&
ePin_Number
,
SCH_COMPONENT
*
eComponent
)
{
LIB_COMPONENT
*
Entry
;
LIB_PIN
*
Pin
;
LIB_PIN
_LIST
pinList
;
int
Unit
,
Convert
;
Entry
=
CMP_LIBRARY
::
FindLibraryComponent
(
eComponent
->
m_ChipName
);
...
...
@@ -637,22 +639,17 @@ LIB_PIN* LocatePinByNumber( const wxString& ePin_Number,
Unit
=
eComponent
->
m_Multi
;
Convert
=
eComponent
->
m_Convert
;
for
(
Pin
=
Entry
->
GetNextPin
();
Pin
!=
NULL
;
Pin
=
Entry
->
GetNextPin
(
Pin
)
)
{
wxASSERT
(
Pin
->
Type
()
!=
COMPONENT_PIN_DRAW_TYPE
);
if
(
Unit
&&
Pin
->
m_Unit
&&
(
Pin
->
m_Unit
!=
Unit
)
)
continue
;
Entry
->
GetPins
(
pinList
,
Unit
,
Convert
);
if
(
Convert
&&
Pin
->
m_Convert
&&
(
Pin
->
m_Convert
!=
Convert
)
)
continue
;
for
(
size_t
i
=
0
;
i
<
pinList
.
size
();
i
++
)
{
wxASSERT
(
pinList
[
i
]
->
Type
()
==
COMPONENT_PIN_DRAW_TYPE
);
wxString
pNumber
;
Pin
->
ReturnPinStringNum
(
pNumber
);
pinList
[
i
]
->
ReturnPinStringNum
(
pNumber
);
if
(
ePin_Number
==
pNumber
)
return
Pin
;
return
pinList
[
i
]
;
}
return
NULL
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment