Browse Source

Fix a bug: do not read in front of string s by s[-1].

Still needs more checking: we remmove and add 'params:'?
pre-master-46
Holger Vogt 9 months ago
parent
commit
dd1690521c
  1. 8
      src/frontend/inpcom.c

8
src/frontend/inpcom.c

@ -3645,10 +3645,11 @@ static char *inp_fix_subckt(struct names *subckt_w_params, char *s)
char *equal, *beg, *buffer, *ptr1, *ptr2, *new_str;
equal = strchr(s, '=');
if (equal &&
(!strstr(s, "params:") || !isspace_c(s[-1]))) {
/* get subckt name (ptr1 will point to name) */
if (equal) {
char* paramstr = strstr(s, "params:");
if (!paramstr || !isspace_c(paramstr[-1])) {
/* get subckt name (ptr1 will point to name) */
ptr1 = skip_token(s);
for (ptr2 = ptr1; *ptr2 && !isspace_c(*ptr2) && !isquote(*ptr2);
ptr2++)
@ -3714,6 +3715,7 @@ static char *inp_fix_subckt(struct names *subckt_w_params, char *s)
s = buffer;
}
}
return s;
}

Loading…
Cancel
Save