Prevent crash if there is bad syntax in h, g, e, or f line

This commit is contained in:
Holger Vogt 2021-06-22 00:19:43 +02:00
parent 31fbf910af
commit a4be66b9b0
1 changed files with 4 additions and 1 deletions

View File

@ -9671,8 +9671,11 @@ static int inp_poly_2g6_compat(struct card* deck) {
curr_line = nexttok_noparens(curr_line);
curr_line = nexttok_noparens(curr_line);
curr_line = nexttok_noparens(curr_line);
if (!curr_line)
if (!curr_line) {
fprintf(stderr, "Error: bad syntax of line\n %s\n", thisline);
fprintf(stderr, "No circuit loaded!\n");
return 1;
}
/* exclude all of the following fourth tokens */
if (ciprefix("poly", curr_line))
continue;