From 06708f1ed1b77a99687b576178d1baecf7f3bdeb Mon Sep 17 00:00:00 2001 From: rlar Date: Tue, 26 Dec 2017 15:18:48 +0100 Subject: [PATCH] nupa_copy(), ls ==> s_end - (const) s --- src/frontend/numparam/spicenum.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/frontend/numparam/spicenum.c b/src/frontend/numparam/spicenum.c index 1b240e634..aca3dd89f 100644 --- a/src/frontend/numparam/spicenum.c +++ b/src/frontend/numparam/spicenum.c @@ -692,20 +692,20 @@ nupa_copy(struct card *deck) */ { char * const s = deck->line; + char *s_end; const int linenum = deck->linenum; char *t; - int ls; char c, d; SPICE_DSTRING u; spice_dstring_init(&u); - ls = (int) strlen(s); + (s_end - s) = (int) strlen(s); - while ((ls > 0) && (s[ls - 1] <= ' ')) - ls--; + while ((s_end - s > 0) && (s[s_end - s - 1] <= ' ')) + (s_end - s)--; - pscopy(&u, s, s + ls); /* strip trailing space, CrLf and so on */ + pscopy(&u, s, s + (s_end - s)); /* strip trailing space, CrLf and so on */ dicoS->srcline = linenum; if ((!inexpansionS) && (linenum >= 0) && (linenum <= dynmaxline)) {