stripsomespace(), drop `ls'

This commit is contained in:
rlar 2016-05-22 21:14:38 +02:00
parent cc05c0c05b
commit ca84d10d0a
1 changed files with 3 additions and 4 deletions

View File

@ -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));
}