nupa_copy(), ls ==> s_end - (const) s

This commit is contained in:
rlar 2017-12-26 15:18:48 +01:00
parent 751d377d3e
commit 06708f1ed1
1 changed files with 5 additions and 5 deletions

View File

@ -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)) {