From e824cbd1939de56cb637bc248df772e46c8fad76 Mon Sep 17 00:00:00 2001 From: rlar Date: Sun, 10 Jul 2016 17:00:37 +0200 Subject: [PATCH] INPparseNumMod(), #1/14, return sooner setting txtCard to 0 and cardType to E_MISSING (which is < 0) caused the following `if (cardType >= 0)' to be skipped and then broke out of the enclosing 'while' loop in this case, there where no other statements executed --- src/spicelib/parser/inpgmod.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/spicelib/parser/inpgmod.c b/src/spicelib/parser/inpgmod.c index eb03dfbe1..41be3c22d 100644 --- a/src/spicelib/parser/inpgmod.c +++ b/src/spicelib/parser/inpgmod.c @@ -397,8 +397,8 @@ INPparseNumMod( CKTcircuit* ckt, INPmodel *model, INPtables *tab, char **errMess /* Do nothing */ } else if (cinprefix( cardName, "end", 3 ) ) { /* Terminate parsing */ - txtCard = ((card *) 0); - cardType = E_MISSING; + *errMessage = err; + return( 0 ); } else { /* Error */ tmp = tprintf("Error on card %d : unrecognized name (%s) - ignored",