From edceabbb54eb04bf4b005e9ae911fe2aa85fb101 Mon Sep 17 00:00:00 2001 From: rlar Date: Wed, 10 Jan 2018 13:21:37 +0100 Subject: [PATCH] parser/inpgmod.c, #1/6, cleanup, search, break then process --- src/spicelib/parser/inpgmod.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/spicelib/parser/inpgmod.c b/src/spicelib/parser/inpgmod.c index 56739c278..864febcfe 100644 --- a/src/spicelib/parser/inpgmod.c +++ b/src/spicelib/parser/inpgmod.c @@ -89,18 +89,19 @@ create_model(CKTcircuit *ckt, INPmodel *modtmp, INPtables *tab) for (j = 0; j < *(ft_sim->devices[modtmp->INPmodType]->numModelParms); j++) { if (strcmp(parm, ft_sim->devices[modtmp->INPmodType]->modelParms[j].keyword) == 0) { - - val = INPgetValue(ckt, &line, ft_sim->devices[modtmp->INPmodType]->modelParms[j].dataType, tab); - - error = ft_sim->setModelParm(ckt, modtmp->INPmodfast, - ft_sim->devices[modtmp->INPmodType]->modelParms[j].id, - val, NULL); - if (error) - return error; break; } } + if (j < *(ft_sim->devices[modtmp->INPmodType]->numModelParms)) { + val = INPgetValue(ckt, &line, ft_sim->devices[modtmp->INPmodType]->modelParms[j].dataType, tab); + + error = ft_sim->setModelParm(ckt, modtmp->INPmodfast, + ft_sim->devices[modtmp->INPmodType]->modelParms[j].id, + val, NULL); + if (error) + return error; + } if (j >= *(ft_sim->devices[modtmp->INPmodType]->numModelParms) && strcmp(parm, "level") == 0) { /* just grab the level number and throw away */ /* since we already have that info from pass1 */