From 2514664f7af322dcc75cd55e80f2a195982c53ea Mon Sep 17 00:00:00 2001 From: rlar Date: Fri, 6 May 2016 19:40:38 +0200 Subject: [PATCH] getword(), ls ==> ls_ptr - (const) s --- src/frontend/numparam/xpressn.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/frontend/numparam/xpressn.c b/src/frontend/numparam/xpressn.c index 30285e596..2329c128f 100644 --- a/src/frontend/numparam/xpressn.c +++ b/src/frontend/numparam/xpressn.c @@ -1322,17 +1322,17 @@ getword(const char * const s, SPICE_DSTRINGPTR tstr_p, const char **pi) { const char *iptr; iptr = *pi; - int ls; + const char *ls_ptr; - ls = (int) strlen(s); + (ls_ptr - s) = (int) strlen(s); do iptr++; - while (((iptr - s) < ls) && !alfa(s[(iptr - s) - 1])); + while (((iptr - s) < (ls_ptr - s)) && !alfa(s[(iptr - s) - 1])); spice_dstring_reinit(tstr_p); - while (((iptr - s) <= ls) && (alfa(s[(iptr - s) - 1]) || isdigit_c(s[(iptr - s) - 1]))) { + while (((iptr - s) <= (ls_ptr - s)) && (alfa(s[(iptr - s) - 1]) || isdigit_c(s[(iptr - s) - 1]))) { cadd(tstr_p, toupper_c(s[(iptr - s) - 1])); iptr++; }