From 270e0b615450859ad1f32c5f7f1b25006a9875c0 Mon Sep 17 00:00:00 2001 From: rlar Date: Wed, 22 Nov 2017 22:41:25 +0100 Subject: [PATCH] findsubname(), cleanup --- src/frontend/numparam/spicenum.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/frontend/numparam/spicenum.c b/src/frontend/numparam/spicenum.c index 00e3801fa..992f4889b 100644 --- a/src/frontend/numparam/spicenum.c +++ b/src/frontend/numparam/spicenum.c @@ -164,7 +164,7 @@ findsubname(dico_t *dico, SPICE_DSTRINGPTR dstr_p) while ((p > s) && (p[-1] <= ' ')) 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] > ' ')) { if (p[-1] == '}') { @@ -179,7 +179,7 @@ findsubname(dico_t *dico, SPICE_DSTRINGPTR dstr_p) p--; } - p_end = s + (int) (p - s - 1) + 1; /* p_end points to '{' */ + p_end = p; /* p_end points to '{' */ } else { p--; @@ -195,7 +195,7 @@ findsubname(dico_t *dico, SPICE_DSTRINGPTR dstr_p) cadd(&name, toupper_c(*t)); entry = entrynb(dico, spice_dstring_value(&name)); 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)); return; }