error check for strrchr() NULL return value in print_spice_element()

This commit is contained in:
Stefan Schippers 2020-10-24 03:15:08 +02:00
parent 032bbf6f24
commit 41e5d02edb
1 changed files with 2 additions and 1 deletions

View File

@ -1658,7 +1658,8 @@ void print_spice_element(FILE *fd, int inst)
}
/* do a second round of substitutions, but without calling tcl */
if(result && strstr(result, "eval(") == result) {
strrchr(result, ')')[0]= '\0';
char *c = strrchr(result, ')');
if(c) *c = '\0';
my_strdup2(88, &result, translate(inst, result+5));
}
fprintf(fd, "%s", result);