findsubname(), cleanup

This commit is contained in:
rlar 2017-11-22 22:41:25 +01:00
parent a5c743d48c
commit 270e0b6154
1 changed files with 3 additions and 3 deletions

View File

@ -164,7 +164,7 @@ findsubname(dico_t *dico, SPICE_DSTRINGPTR dstr_p)
while ((p > s) && (p[-1] <= ' ')) while ((p > s) && (p[-1] <= ' '))
p--; p--;
char *p_end = s + (int) (p - s - 1) + 1; /* at p_end: space */ char *p_end = p; /* 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--;
} }
p_end = s + (int) (p - s - 1) + 1; /* p_end points to '{' */ p_end = p; /* p_end points to '{' */
} else { } else {
p--; p--;
@ -195,7 +195,7 @@ 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 ((int) (p_end - s) < (int) (ls_ptr - s)) if (p_end < ls_ptr)
pscopy(dstr_p, s, 0, (int) (p_end - s)); pscopy(dstr_p, s, 0, (int) (p_end - s));
return; return;
} }