[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
gEDA-cvs: pcb.git: branch: master updated (33dcf48124dc6164aa32393fc536b2e2f270f5b7)
The branch, master has been updated
via 33dcf48124dc6164aa32393fc536b2e2f270f5b7 (commit)
from 3d9bd8bdcaa23ca2c8bc62b4cb4c6ee50d579f1c (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
src/report.c | 42 ++++++++++++++++++++++++++----------------
1 files changed, 26 insertions(+), 16 deletions(-)
=================
Commit Messages
=================
commit 33dcf48124dc6164aa32393fc536b2e2f270f5b7
Author: DJ Delorie <dj@xxxxxxxxxxx>
Date: Sun Mar 8 03:53:00 2009 -0400
bugfix: avoid NULL pin names with Report(NetLength)
There was an assumption that all pins and pads have non-NULL
names, but if you create a .pcb with a script you could end up
with anything. Make sure the names we get are non-NULL before
using them.
:100644 100644 af9e0b3... 0c610d1... M src/report.c
=========
Changes
=========
commit 33dcf48124dc6164aa32393fc536b2e2f270f5b7
Author: DJ Delorie <dj@xxxxxxxxxxx>
Date: Sun Mar 8 03:53:00 2009 -0400
bugfix: avoid NULL pin names with Report(NetLength)
There was an assumption that all pins and pads have non-NULL
names, but if you create a .pcb with a script you could end up
with anything. Make sure the names we get are non-NULL before
using them.
diff --git a/src/report.c b/src/report.c
index af9e0b3..0c610d1 100644
--- a/src/report.c
+++ b/src/report.c
@@ -599,16 +599,21 @@ ReportNetLength (int argc, char **argv, int x, int y)
int ni, nei;
char *ename = element->Name[NAMEONPCB_INDEX].TextString;
char *pname = pin->Number;
- char *n = Concat (ename, "-", pname, NULL);
- for (ni = 0; ni < PCB->NetlistLib.MenuN; ni++)
- for (nei = 0; nei < PCB->NetlistLib.Menu[ni].EntryN; nei++)
- {
- if (strcmp (PCB->NetlistLib.Menu[ni].Entry[nei].ListEntry, n) == 0)
+ char *n;
+
+ if (ename && pname)
+ {
+ n = Concat (ename, "-", pname, NULL);
+ for (ni = 0; ni < PCB->NetlistLib.MenuN; ni++)
+ for (nei = 0; nei < PCB->NetlistLib.Menu[ni].EntryN; nei++)
{
- netname = PCB->NetlistLib.Menu[ni].Name + 2;
- goto got_net_name; /* four for loops deep */
+ if (strcmp (PCB->NetlistLib.Menu[ni].Entry[nei].ListEntry, n) == 0)
+ {
+ netname = PCB->NetlistLib.Menu[ni].Name + 2;
+ goto got_net_name; /* four for loops deep */
+ }
}
- }
+ }
}
}
END_LOOP;
@@ -619,16 +624,21 @@ ReportNetLength (int argc, char **argv, int x, int y)
int ni, nei;
char *ename = element->Name[NAMEONPCB_INDEX].TextString;
char *pname = pad->Number;
- char *n = Concat (ename, "-", pname, NULL);
- for (ni = 0; ni < PCB->NetlistLib.MenuN; ni++)
- for (nei = 0; nei < PCB->NetlistLib.Menu[ni].EntryN; nei++)
- {
- if (strcmp (PCB->NetlistLib.Menu[ni].Entry[nei].ListEntry, n) == 0)
+ char *n;
+
+ if (ename && pname)
+ {
+ n = Concat (ename, "-", pname, NULL);
+ for (ni = 0; ni < PCB->NetlistLib.MenuN; ni++)
+ for (nei = 0; nei < PCB->NetlistLib.Menu[ni].EntryN; nei++)
{
- netname = PCB->NetlistLib.Menu[ni].Name + 2;
- goto got_net_name; /* four for loops deep */
+ if (strcmp (PCB->NetlistLib.Menu[ni].Entry[nei].ListEntry, n) == 0)
+ {
+ netname = PCB->NetlistLib.Menu[ni].Name + 2;
+ goto got_net_name; /* four for loops deep */
+ }
}
- }
+ }
}
}
END_LOOP;
_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs