From 110f16b3618090dd0d27fd7bf257fb713e09a154 Mon Sep 17 00:00:00 2001 From: rlar Date: Sun, 10 Jul 2016 16:46:53 +0200 Subject: [PATCH] INPparseNumMod(), #6/14, again, assign 'lastType' sooner in the block in-between those two positions there is no access to lastType there is no 'continue' there is no 'break' out of the enclosing switch thus the assignment is inevitable there is one position where cardType is modified, need to assign to lastType there too to keep it in sync --- src/spicelib/parser/inpgmod.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/spicelib/parser/inpgmod.c b/src/spicelib/parser/inpgmod.c index 638019417..5989bb3f3 100644 --- a/src/spicelib/parser/inpgmod.c +++ b/src/spicelib/parser/inpgmod.c @@ -379,12 +379,14 @@ INPparseNumMod( CKTcircuit* ckt, INPmodel *model, INPtables *tab, char **errMess } /* FALL THRU when continuing a card */ default: + lastType = cardType; if (cardType == E_MISSING) { /* new command card */ if (cardName) FREE(cardName); /* get rid of old card name */ INPgetTok(&line,&cardName,1); /* get new card name */ if (*cardName) { /* Found a name? */ cardType = INPfindCard(cardName,INPcardTab,INPnumCards); + lastType = cardType; if (cardType >= 0) { /* Add card structure to model */ info = INPcardTab[cardType]; @@ -407,7 +409,6 @@ INPparseNumMod( CKTcircuit* ckt, INPmodel *model, INPtables *tab, char **errMess } } } - lastType = cardType; // cardType is not used downwards from here if (lastType >= 0) { /* parse the rest of this line */ while (*line) {