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 a86a500b07
commit 058f474f90
1 changed files with 8 additions and 0 deletions

View File

@ -9481,6 +9481,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 == '{') {
@ -9499,6 +9503,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 == '{') {