Prevent from endless loop if step evaluates to 0.

This commit is contained in:
Holger Vogt 2025-06-28 16:07:42 +02:00
parent 99ed8ceb66
commit 62d3e3a51d
1 changed files with 4 additions and 0 deletions

View File

@ -313,6 +313,8 @@ dot_dc(char *line, CKTcircuit *ckt, INPtables *tab, struct card *current,
if (*line == '\0')
return 1;
parm = INPgetValue(ckt, &line, IF_REAL, tab); /* vinc1 */
if (parm->rValue == 0)
return 1;
GCA(INPapName, (ckt, which, foo, "step1", parm));
if (*line) {
INPgetTok(&line, &name, 1);
@ -330,6 +332,8 @@ dot_dc(char *line, CKTcircuit *ckt, INPtables *tab, struct card *current,
return 1;
GCA(INPapName, (ckt, which, foo, "stop2", parm));
parm = INPgetValue(ckt, &line, IF_REAL, tab); /* vinc2 */
if (parm->rValue == 0)
return 1;
GCA(INPapName, (ckt, which, foo, "step2", parm));
}
return 0;