Browse Source

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
pre-master-46
rlar 10 years ago
parent
commit
c1c7b5305e
  1. 3
      src/spicelib/parser/inpgmod.c

3
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 );

Loading…
Cancel
Save