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
06011d6e
Commit
06011d6e
authored
Jan 23, 2008
by
dickelbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed a crash which happened if there were no pads at all.
parent
300d50b1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
7 deletions
+15
-7
export_gencad.cpp
pcbnew/export_gencad.cpp
+15
-7
No files found.
pcbnew/export_gencad.cpp
View file @
06011d6e
...
...
@@ -183,7 +183,10 @@ void CreatePadsShapesSection( FILE* file, BOARD* pcb )
* pour les formes de pad PAD1 a PADn
*/
{
D_PAD
*
pad
,
**
padlist
,
**
pad_list_base
;
D_PAD
*
pad
;
D_PAD
**
padlist
;
D_PAD
**
pad_list_base
=
NULL
;
const
char
*
pad_type
;
int
memsize
,
ii
,
dx
,
dy
;
D_PAD
*
old_pad
=
NULL
;
...
...
@@ -191,11 +194,14 @@ void CreatePadsShapesSection( FILE* file, BOARD* pcb )
fputs
(
"$PADS
\n
"
,
file
);
// Generation de la liste des pads tries par forme et dimensions:
memsize
=
(
pcb
->
m_NbPads
+
1
)
*
sizeof
(
D_PAD
*
);
pad_list_base
=
(
D_PAD
**
)
MyZMalloc
(
memsize
);
memcpy
(
pad_list_base
,
pcb
->
m_Pads
,
memsize
);
qsort
(
pad_list_base
,
pcb
->
m_NbPads
,
sizeof
(
D_PAD
*
),
Pad_list_Sort_by_Shapes
);
if
(
pcb
->
m_NbPads
>
0
)
{
// Generation de la liste des pads tries par forme et dimensions:
memsize
=
(
pcb
->
m_NbPads
+
1
)
*
sizeof
(
D_PAD
*
);
pad_list_base
=
(
D_PAD
**
)
MyZMalloc
(
memsize
);
memcpy
(
pad_list_base
,
pcb
->
m_Pads
,
memsize
);
qsort
(
pad_list_base
,
pcb
->
m_NbPads
,
sizeof
(
D_PAD
*
),
Pad_list_Sort_by_Shapes
);
}
pad_name_number
=
0
;
for
(
padlist
=
pad_list_base
,
ii
=
0
;
ii
<
pcb
->
m_NbPads
;
padlist
++
,
ii
++
)
...
...
@@ -295,7 +301,9 @@ void CreatePadsShapesSection( FILE* file, BOARD* pcb )
}
fputs
(
"$ENDPADS
\n\n
"
,
file
);
MyFree
(
pad_list_base
);
if
(
pad_list_base
)
MyFree
(
pad_list_base
);
}
...
...
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