From d4dad0f10cee7b1a961bfdbba3539d9bafef4c07 Mon Sep 17 00:00:00 2001 From: rlar Date: Fri, 17 Nov 2017 16:57:33 +0100 Subject: [PATCH] stripbraces(), i ==> i_ptr - (const) s --- src/frontend/numparam/spicenum.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/frontend/numparam/spicenum.c b/src/frontend/numparam/spicenum.c index 7210f1781..68175cb4e 100644 --- a/src/frontend/numparam/spicenum.c +++ b/src/frontend/numparam/spicenum.c @@ -105,11 +105,11 @@ stripbraces(SPICE_DSTRINGPTR dstr_p) while ((brace = strchr(s0 + i, '{')) != NULL) { char * const s = s0; - i = (int) (brace - s); + i_ptr - s = (int) (brace - s); /* something to strip */ - const char *j_ptr = s + i + 1; + const char *j_ptr = s + (i_ptr - s) + 1; nest = 1; n++; @@ -121,9 +121,9 @@ stripbraces(SPICE_DSTRINGPTR dstr_p) j_ptr++; } - pscopy(&tstr, s, 0, i); + pscopy(&tstr, s, 0, (int) (i_ptr - s)); - if (s[i - 1] > ' ') + if (s[(i_ptr - s) - 1] > ' ') cadd(&tstr, ' '); cadd(&tstr, ' ');