parser/inpgmod.c, fix an almost bug, (level=...)
When 'level' was a valid model parameter, it was processed like any other parameter, but additionally the ´if (strcmp(parm. "level"))' invoked INPgetValue() a second time. This didn't cause harm, merely because the next token after the level=number almost necessarily is a string (the bginning parameter= of the next assignment) thus not a parse-able number, and thus the second INPgetValue didn't modify the 'line' pointer. For clarity invoke the "level" skipping only if "level" is not a valid model parameter.
This commit is contained in:
parent
408e3239f0
commit
5bc1a4163c
|
|
@ -105,7 +105,7 @@ create_model(CKTcircuit *ckt, INPmodel *modtmp, INPtables *tab)
|
|||
}
|
||||
}
|
||||
|
||||
if (strcmp(parm, "level") == 0) {
|
||||
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 */
|
||||
val = INPgetValue(ckt, &line, IF_REAL, tab);
|
||||
|
|
|
|||
Loading…
Reference in New Issue