findsubname(), h ==> p_end - (const) s
This commit is contained in:
parent
8881aead44
commit
21d3f04659
|
|
@ -164,7 +164,7 @@ findsubname(dico_t *dico, SPICE_DSTRINGPTR dstr_p)
|
||||||
while ((p > s) && (p[-1] <= ' '))
|
while ((p > s) && (p[-1] <= ' '))
|
||||||
p--;
|
p--;
|
||||||
|
|
||||||
int h = (int) (p - s - 1) + 1; /* at h: space */
|
int (p_end - s) = (int) (p - s - 1) + 1; /* at p_end: space */
|
||||||
while ((p > s) && (p[-1] > ' ')) {
|
while ((p > s) && (p[-1] > ' ')) {
|
||||||
|
|
||||||
if (p[-1] == '}') {
|
if (p[-1] == '}') {
|
||||||
|
|
@ -179,7 +179,7 @@ findsubname(dico_t *dico, SPICE_DSTRINGPTR dstr_p)
|
||||||
|
|
||||||
p--;
|
p--;
|
||||||
}
|
}
|
||||||
h = (int) (p - s - 1) + 1; /* h points to '{' */
|
(p_end - s) = (int) (p - s - 1) + 1; /* p_end points to '{' */
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
p--;
|
p--;
|
||||||
|
|
@ -195,8 +195,8 @@ findsubname(dico_t *dico, SPICE_DSTRINGPTR dstr_p)
|
||||||
cadd(&name, toupper_c(*t));
|
cadd(&name, toupper_c(*t));
|
||||||
entry = entrynb(dico, spice_dstring_value(&name));
|
entry = entrynb(dico, spice_dstring_value(&name));
|
||||||
if (entry && (entry->tp == NUPA_SUBCKT)) {
|
if (entry && (entry->tp == NUPA_SUBCKT)) {
|
||||||
if (h < (int) (ls_ptr - s))
|
if ((int) (p_end - s) < (int) (ls_ptr - s))
|
||||||
pscopy(dstr_p, s, 0, h);
|
pscopy(dstr_p, s, 0, (int) (p_end - s));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue