safeguard against crash upon buggy input

This commit is contained in:
Holger Vogt 2023-05-17 09:32:23 +02:00
parent c723e124d9
commit ba7ad783a8
1 changed files with 5 additions and 1 deletions

View File

@ -4483,7 +4483,8 @@ static int inp_get_param_level(
return level;
}
/* Return the number of terminals for a given device, characterized by
the first letter of its instance line. Returns 0 upon error. */
int get_number_terminals(char *c)
{
int i, j, k;
@ -4491,6 +4492,9 @@ int get_number_terminals(char *c)
char nam_buf[128];
bool area_found = FALSE;
if (!c)
return 0;
switch (*c) {
case 'r':
case 'c':