From 53078588aec57b02c4c8e269e9887b745a266d5e Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Thu, 6 Jun 2019 14:53:07 -0400 Subject: [PATCH] Changed the size of argv[] in efReadLine() to be 128 instead of 64 because I overran the 64 array with too many resistclasses in a techfile. This really should be dynamically allocated; this requires parsing the line to count tokens and reallocating as needed (to be done). --- ext2spice/ext2spice.c | 1 + extflat/EFbuild.c | 4 ++-- extflat/EFread.c | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ext2spice/ext2spice.c b/ext2spice/ext2spice.c index 1129300b..1aa1bfc9 100644 --- a/ext2spice/ext2spice.c +++ b/ext2spice/ext2spice.c @@ -1685,6 +1685,7 @@ topVisit(def, doStub) EFNodeName *unnumbered; sname = (EFNodeName *) HashGetValue(he); + if (sname == NULL) continue; /* Should not happen */ snode = sname->efnn_node; if (!(snode->efnode_flags & EF_PORT)) continue; diff --git a/extflat/EFbuild.c b/extflat/EFbuild.c index d6b11fd6..684168f1 100644 --- a/extflat/EFbuild.c +++ b/extflat/EFbuild.c @@ -223,8 +223,8 @@ efAdjustSubCap(def, nodeName, nodeCapAdjust) EFNode *node; HashEntry *he; - he = HashFind(&def->def_nodes, nodeName); - if (nodename = (EFNodeName *) HashGetValue(he)) + he = HashLookOnly(&def->def_nodes, nodeName); + if (he && (nodename = (EFNodeName *) HashGetValue(he))) { node = nodename->efnn_node; node->efnode_cap += (EFCapValue) nodeCapAdjust; diff --git a/extflat/EFread.c b/extflat/EFread.c index c8c4471e..81384a5c 100644 --- a/extflat/EFread.c +++ b/extflat/EFread.c @@ -174,7 +174,7 @@ efReadDef(def, dosubckt, resist, noscale, toplevel) int argc, ac, n; CellDef *dbdef; EFCapValue cap; - char line[1024], *argv[64], *name, *attrs; + char line[1024], *argv[128], *name, *attrs; int rscale = 1; /* Multiply resistances by this */ int cscale = 1; /* Multiply capacitances by this */ float lscale = 1.0; /* Multiply lambda by this */