diff --git a/src/frontend/numparam/xpressn.c b/src/frontend/numparam/xpressn.c index adc6d0dac..4546f4e05 100644 --- a/src/frontend/numparam/xpressn.c +++ b/src/frontend/numparam/xpressn.c @@ -1341,7 +1341,7 @@ getexpress(const char * const s, SPICE_DSTRINGPTR tstr_p, const char **pi) */ { const char *iptr; - (iptr - s) = *pi - s; + iptr = *pi - s + s; int ia, ls, level; char c, d; nupa_type tpe; @@ -1355,15 +1355,15 @@ getexpress(const char * const s, SPICE_DSTRINGPTR tstr_p, const char **pi) if (s[ia - 1] == '"') { /* string constant */ ia++; - (iptr - s) = ia; + iptr = ia + s; while (((iptr - s) < ls) && (s[(iptr - s) - 1] != '"')) - (iptr - s)++; + iptr++; tpe = NUPA_STRING; do - (iptr - s)++; + iptr++; while (((iptr - s) <= ls) && (s[(iptr - s) - 1] <= ' ')); } else { @@ -1371,11 +1371,11 @@ getexpress(const char * const s, SPICE_DSTRINGPTR tstr_p, const char **pi) if (s[ia - 1] == '{') ia++; - (iptr - s) = ia - 1; + iptr = ia - 1 + s; do { - (iptr - s)++; + iptr++; if ((iptr - s) > ls) c = ';'; @@ -1387,7 +1387,7 @@ getexpress(const char * const s, SPICE_DSTRINGPTR tstr_p, const char **pi) level = 1; do { - (iptr - s)++; + iptr++; if ((iptr - s) > ls) d = '\0'; @@ -1410,10 +1410,10 @@ getexpress(const char * const s, SPICE_DSTRINGPTR tstr_p, const char **pi) pscopy(tstr_p, s, ia-1, (int) (iptr - s) - ia); if (s[(iptr - s) - 1] == '}') - (iptr - s)++; + iptr++; if (tpe == NUPA_STRING) - (iptr - s)++; /* beyond quote */ + iptr++; /* beyond quote */ *pi = s + (iptr - s);