From b85a07c62c6e982bf3146fb99e9601536ff95f49 Mon Sep 17 00:00:00 2001 From: rlar Date: Sat, 11 Mar 2017 18:29:12 +0100 Subject: [PATCH] inp2q.c, #19/23, rewrite, move code into the 'for' loop --- src/spicelib/parser/inp2q.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/spicelib/parser/inp2q.c b/src/spicelib/parser/inp2q.c index 50cd0c2da..f1ff6ef42 100644 --- a/src/spicelib/parser/inp2q.c +++ b/src/spicelib/parser/inp2q.c @@ -78,16 +78,13 @@ void INP2Q(CKTcircuit *ckt, INPtables * tab, card * current, CKTnode *gnode) current->error = INPgetMod(ckt, model, &thismodel, tab); break; } - if (i >= max_i) - break; + if (i >= max_i) { + LITERR ("could not find a valid modelname"); + return; + } INPtermInsert(ckt, &nname[i], tab, &node[i]); } - if (!model) { - LITERR ("could not find a valid modelname"); - return; - } - if (i == 3) { /* 3-terminal device - substrate to ground */ node[3] = gnode;