On Wednesday, 11 October 2017 17:23:45 CEST Richard W.M. Jones wrote:
+static int
+mexp_vprintf (mexp_h *h, int password, const char *fs, va_list args)
{
- va_list args;
char *msg;
int len;
size_t n;
ssize_t r;
char *p;
- va_start (args, fs);
len = vasprintf (&msg, fs, args);
- va_end (args);
Due to the nature of va_list (whose implementation greatly differs per
architecture -- from a pointer, to a list of pointers, to structs, etc),
I think that here you need to copy the va_list using va_copy(), and
pass the copy to vasprintf.
I cannot find a better reference, but
https://stackoverflow.com/questions/3369588/pass-va-list-or-pointer-to-va...
has a piece of advice on that.
--
Pino Toscano