nupa_assignment(), cleanup

This commit is contained in:
rlar 2017-11-18 15:33:31 +01:00
parent 8f9f03c457
commit 8bded8b878
1 changed files with 6 additions and 6 deletions

View File

@ -1433,7 +1433,7 @@ nupa_assignment(dico_t *dico, const char * const s, char mode)
spice_dstring_init(&ustr);
error = 0;
while (((p - s) < (s_end - s)) && (*p <= ' '))
while ((p < s_end) && (*p <= ' '))
p++;
if (*p == Intro)
@ -1443,7 +1443,7 @@ nupa_assignment(dico_t *dico, const char * const s, char mode)
while (*p > ' ')
p++;
while (((p - s) < (s_end - s)) && !error) {
while ((p < s_end) && !error) {
p = getword(p, &tstr) + 1;
t_p = spice_dstring_value(&tstr);
@ -1452,13 +1452,13 @@ nupa_assignment(dico_t *dico, const char * const s, char mode)
if (!error) {
/* assignment expressions */
while (((p - s) <= (s_end - s)) && (p[-1] != '='))
while ((p <= s_end) && (p[-1] != '='))
p++;
if ((p - s) > (s_end - s))
if (p > s_end)
error = message(dico, " = sign expected.\n");
const char *tmp = s + (p - s);
const char *tmp = p;
tmp = getexpress(&dtype, &ustr, tmp) + 1;
p = tmp;
@ -1478,7 +1478,7 @@ nupa_assignment(dico_t *dico, const char * const s, char mode)
error = error || err;
}
if (((p - s) < (s_end - s)) && (p[-1] != ';'))
if ((p < s_end) && (p[-1] != ';'))
error = message(dico, " ; sign expected.\n");
/* else
p++; */