Browse Source

inpcom.c: avoid segfault when `TABLE' is used without parentheses

pre-master-46
Krzysztof Blaszkowski 13 years ago
committed by rlar
parent
commit
23cdd5e53f
  1. 5
      src/frontend/inpcom.c

5
src/frontend/inpcom.c

@ -4369,6 +4369,11 @@ inp_compat(struct line *card)
secondno = gettok_node(&cut_line);
midline = cut_line;
cut_line = strrchr(str_ptr, '(');
if (!cut_line) {
fprintf(stderr, "Error: bad syntax in line %d (missing parentheses)\n %s\n",
card->li_linenum_orig, card->li_line);
controlled_exit(EXIT_BAD);
}
/* replace '(' with ',' and ')' with ' ' */
for (; *str_ptr; str_ptr++)
if (*str_ptr == '(')

Loading…
Cancel
Save