From c1c7b5305ee3f61afa90c34e140fb3ee54f14bc3 Mon Sep 17 00:00:00 2001 From: rlar Date: Sun, 10 Jul 2016 17:04:43 +0200 Subject: [PATCH] INPparseNumMod(), #2/14, transform the `while' loop into a `for' loop there was no 'continue' for this loop there was no 'break' out of this loop there was no assignment to txtCard, thus txtCard can't be NULL --- src/spicelib/parser/inpgmod.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/spicelib/parser/inpgmod.c b/src/spicelib/parser/inpgmod.c index 41be3c22d..653595299 100644 --- a/src/spicelib/parser/inpgmod.c +++ b/src/spicelib/parser/inpgmod.c @@ -346,7 +346,7 @@ INPparseNumMod( CKTcircuit* ckt, INPmodel *model, INPtables *tab, char **errMess if (txtCard) txtCard = txtCard->nextcard; /* Now parse each remaining card */ - while (txtCard) { + for (; txtCard; txtCard = txtCard->nextcard) { line = txtCard->line; cardType = E_MISSING; cardNum++; @@ -453,7 +453,6 @@ INPparseNumMod( CKTcircuit* ckt, INPmodel *model, INPtables *tab, char **errMess lastType = cardType; break; } - if (txtCard) txtCard = txtCard->nextcard; } *errMessage = err; return( 0 );