Minor change

* tests/wsp.c (main): use additional variable to keep the
allocated value in incremental mode.
This commit is contained in:
Sergey Poznyakoff 2014-09-10 18:30:29 +03:00
parent 3ad0ad462c
commit ff39e877ee

View file

@ -184,7 +184,7 @@ wsp_getvar (const char *vptr, size_t vlen, void *data)
int
main (int argc, char **argv)
{
char buf[1024], *ptr;
char buf[1024], *ptr, *saved_ptr;
int i, offarg = 0;
int trimnl_option = 0;
int plaintext_option = 0;
@ -366,13 +366,13 @@ main (int argc, char **argv)
if (*ptr == 0)
ptr = NULL;
else
free ((void*)ws.ws_input);
free (saved_ptr);
}
else
next_call = 1;
if (ptr)
{
ptr = strdup (ptr);
ptr = saved_ptr = strdup (ptr);
assert (ptr != NULL);
}
}