safeguard against crash upon buggy input
This commit is contained in:
parent
c723e124d9
commit
ba7ad783a8
|
|
@ -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':
|
||||
|
|
|
|||
Loading…
Reference in New Issue