getword(), third argument, `char **pi' instead of `int *pi'

This commit is contained in:
rlar 2017-11-12 21:08:26 +01:00
parent 6ba5a05905
commit 051c3f4137
1 changed files with 6 additions and 4 deletions

View File

@ -1317,10 +1317,10 @@ nupa_substitute(dico_t *dico, const char *s, char *r)
static void
getword(const char * const s, SPICE_DSTRINGPTR tstr_p, int *pi)
getword(const char * const s, SPICE_DSTRINGPTR tstr_p, const char **pi)
/* isolate a word from s after position "after". return i= last read+1 */
{
int i = *pi;
int i = (int) (*pi - s);
int ls;
ls = (int) strlen(s);
@ -1336,7 +1336,7 @@ getword(const char * const s, SPICE_DSTRINGPTR tstr_p, int *pi)
i++;
}
*pi = i;
*pi = s + i;
}
@ -1463,7 +1463,9 @@ nupa_assignment(dico_t *dico, char *s, char mode)
while ((i < ls) && !error) {
getword(s, &tstr, &i);
const char *tmp = s + i;
getword(s, &tstr, &tmp);
i = (int) (tmp - s);
t_p = spice_dstring_value(&tstr);
if (t_p[0] == '\0')
error = message(dico, " Identifier expected\n");