From ca84d10d0a46af4c975e841a185a8ed4c67c39ff Mon Sep 17 00:00:00 2001 From: rlar Date: Sun, 22 May 2016 21:14:38 +0200 Subject: [PATCH] stripsomespace(), drop `ls' --- src/frontend/numparam/spicenum.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/frontend/numparam/spicenum.c b/src/frontend/numparam/spicenum.c index bde028447..507bed972 100644 --- a/src/frontend/numparam/spicenum.c +++ b/src/frontend/numparam/spicenum.c @@ -78,14 +78,13 @@ stripsomespace(SPICE_DSTRINGPTR dstr_p, bool incontrol) : "*.&+#$" "xX"; char *s = spice_dstring_value(dstr_p); - int ls = spice_dstring_length(dstr_p); int i = 0; - while ((i < ls) && (s[i] <= ' ')) + while (s[i] && (s[i] <= ' ')) i++; - if ((i > 0) && (i < ls) && strchr(markers, s[i])) - pscopy(dstr_p, s, i, ls); + if ((i > 0) && s[i] && strchr(markers, s[i])) + pscopy(dstr_p, s + i, 0, (int) strlen(s + i)); }