diff --git a/src/spicelib/parser/inp2p.c b/src/spicelib/parser/inp2p.c index 633a304f7..b361e495f 100644 --- a/src/spicelib/parser/inp2p.c +++ b/src/spicelib/parser/inp2p.c @@ -67,7 +67,6 @@ int num, i; node1 = (void **) tmalloc(num * sizeof(void *)); node2 = (void **) tmalloc(num * sizeof(void *)); - for (i = 0; i < num; i++) { INPgetNetTok(&line,&(nname1[i]),1); INPtermInsert(ckt,&(nname1[i]),tab,&(node1[i])); @@ -82,11 +81,6 @@ int num, i; INPtermInsert(ckt,&ground,tab,&groundnode); INPgetTok(&line,&model,1); - if (strcmp(model, "len") == 0) { - lenval = INPevaluate(&line,&error1,1); - lenvalgiven = 1; - INPgetTok(&line,&model,1); - } if(*model) { /* token isn't null */ INPinsert(&model,tab); thismodel = (INPmodel *)NULL; @@ -108,6 +102,11 @@ int num, i; mdfast = tab->defPmod; } IFC(newInstance,(ckt,mdfast,&fast,name)) + INPgetTok(&line,&model,1); + if (strcmp(model, "len") == 0) { + lenval = INPevaluate(&line,&error1,1); + lenvalgiven = 1; + } } else { LITERR("model name is not found") return; diff --git a/src/spicelib/parser/inp2y.c b/src/spicelib/parser/inp2y.c index adbe12e48..86f6f99c8 100644 --- a/src/spicelib/parser/inp2y.c +++ b/src/spicelib/parser/inp2y.c @@ -70,15 +70,15 @@ int lenvalgiven = 0; INPtermInsert(ckt,&ground2,tab,&gnode2); INPgetTok(&line,&model,1); - if (strcmp(model, "len") == 0) { - lenval = INPevaluate(&line,&error1,1); - lenvalgiven = 1; - INPgetTok(&line,&model,1); - } if(*model) { /* token isn't null */ INPinsert(&model,tab); thismodel = (INPmodel *)NULL; current->error = INPgetMod(ckt,model,&thismodel,tab); + INPgetTok(&line,&model,1); + if (strcmp(model, "len") == 0) { + lenval = INPevaluate(&line,&error1,1); + lenvalgiven = 1; + } if(thismodel != NULL) { if (thismodel->INPmodType == mytype2) { INP2P(ckt,tab,current);