Avoid crash, and send error message when r,l,c

instance lines does not have enough tokens.
This commit is contained in:
Holger Vogt 2019-09-06 22:45:11 +02:00
parent f9deefe326
commit 972785095f
1 changed files with 5 additions and 0 deletions

View File

@ -7461,6 +7461,11 @@ static struct card *pspice_compat(struct card *oldcard)
char *ntok = nexttok(cut_line);
ntok = nexttok(ntok);
ntok = nexttok(ntok);
if (!ntok){
fprintf(stderr, "Error: Missing token in line %d:\n%s\n", card->linenum, cut_line);
fprintf(stderr, " Please correct the input file\n");
controlled_exit(1);
}
char *tctok = search_plain_identifier(ntok, "tc");
if (tctok) {
char *tctok1 = strchr(tctok, '=');