getword(), substitute s = s - 1

This commit is contained in:
rlar 2016-05-01 17:32:56 +02:00
parent 68b0be8caa
commit d6801c0cf1
1 changed files with 5 additions and 5 deletions

View File

@ -1326,12 +1326,12 @@ getword(const char *s, const char * const s_end, SPICE_DSTRINGPTR tstr_p)
spice_dstring_reinit(tstr_p);
while ((s - 1 < s_end) && (alfa(s[-1]) || isdigit_c(s[-1]))) {
cadd(tstr_p, toupper_c(s[-1]));
s++;
}
s--;
return s;
while ((s < s_end) && (alfa(*s) || isdigit_c(*s)))
cadd(tstr_p, toupper_c(*s++));
return s + 1;
}