inpcom.c, bug fix, avoid segfault when `.ends' is missing

This commit is contained in:
rlar 2015-08-15 11:57:02 +02:00
parent 61724121aa
commit db9eb23b7d
1 changed files with 7 additions and 1 deletions

View File

@ -3214,8 +3214,14 @@ inp_expand_macros_in_deck(struct function_env *env, struct line *c)
continue;
if (ciprefix(".subckt", c->li_line)) {
struct line *subckt = c;
c = inp_expand_macros_in_deck(env, c->li_next);
continue;
if (c)
continue;
fprintf(stderr, "Error: line %d, missing .ends\n %s\n",
subckt->li_linenum_orig, subckt->li_line);
controlled_exit(EXIT_BAD);
}
if (ciprefix(".ends", c->li_line))