Prevent crash if netlist input is something like

H n1
This commit is contained in:
Holger Vogt 2021-01-20 09:12:24 +01:00
parent deeee2950f
commit 9579f55824
1 changed files with 8 additions and 0 deletions

View File

@ -9479,6 +9479,10 @@ static void inp_poly_2g6_compat(struct card* deck) {
case 'e':
curr_line = nexttok(curr_line);
curr_line = nexttok(curr_line);
if (!curr_line) {
fprintf(stderr, "Error: not enough parameters in line\n %s\n", thisline);
controlled_exit(1);
}
/* The next token may be a simple text token or an expression
enclosed in brackets */
if (*curr_line == '{') {
@ -9497,6 +9501,10 @@ static void inp_poly_2g6_compat(struct card* deck) {
case 'f':
case 'h':
curr_line = nexttok(curr_line);
if (!curr_line) {
fprintf(stderr, "Error: not enough parameters in line\n %s\n", thisline);
controlled_exit(1);
}
/* The next token may be a simple text token or an expression
enclosed in brackets */
if (*curr_line == '{') {