From c5ce68728ff630bea8b411deef0fe26fc246d983 Mon Sep 17 00:00:00 2001 From: rlar Date: Thu, 9 Mar 2017 21:41:43 +0100 Subject: [PATCH] inp2q.c, #10/23, use i to prepare for a loop --- src/spicelib/parser/inp2q.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/spicelib/parser/inp2q.c b/src/spicelib/parser/inp2q.c index a350194c8..fdf2955fe 100644 --- a/src/spicelib/parser/inp2q.c +++ b/src/spicelib/parser/inp2q.c @@ -69,6 +69,7 @@ void INP2Q(CKTcircuit *ckt, INPtables * tab, card * current, CKTnode *gnode) INPtermInsert(ckt, &nname[i], tab, &node[i]); } + i = 3; INPgetTok(&line, &model, 1); thismodel = NULL; @@ -79,8 +80,9 @@ void INP2Q(CKTcircuit *ckt, INPtables * tab, card * current, CKTnode *gnode) INPinsert(&model, tab); current->error = INPgetMod(ckt, model, &thismodel, tab); } else { - nname[3] = model; - INPtermInsert(ckt, &nname[3], tab, &node[3]); + nname[i] = model; + INPtermInsert(ckt, &nname[i], tab, &node[i]); + i = 4; INPgetTok(&line, &model, 1); if (INPlookMod(model)) { /* 4-terminal device - special case with tnodeout flag not handled */ @@ -99,8 +101,9 @@ void INP2Q(CKTcircuit *ckt, INPtables * tab, card * current, CKTnode *gnode) } } else { nodeflag = 5; /* now specify a 5 node device */ - nname[4] = model; - INPtermInsert(ckt, &nname[4], tab, &node[4]); + nname[i] = model; + INPtermInsert(ckt, &nname[i], tab, &node[i]); + i = 5; INPgetTok(&line, &model, 1); INPinsert(&model, tab); current->error = INPgetMod(ckt, model, &thismodel, tab);