# HG changeset patch # User Olaf Wintermann # Date 1513088551 -3600 # Node ID ad45ba74fe1bfc78d36c1b7d6a83e0067c672fcc # Parent a66e0a1f01fc6d20d1a90078294877ad9d529a61 fixes wrong use of va_list diff -r a66e0a1f01fc -r ad45ba74fe1b libidav/davqlexec.c --- a/libidav/davqlexec.c Sat Oct 07 10:25:11 2017 +0200 +++ b/libidav/davqlexec.c Tue Dec 12 15:22:31 2017 +0100 @@ -66,7 +66,7 @@ return result; } -sstr_t dav_format_string(UcxAllocator *a, sstr_t fstr, va_list ap, davqlerror_t *error) { +sstr_t dav_format_string(UcxAllocator *a, sstr_t fstr, va_list *ap, davqlerror_t *error) { UcxBuffer *buf = ucx_buffer_new(NULL, 128, UCX_BUFFER_AUTOEXTEND); int placeholder = 0; @@ -81,17 +81,17 @@ int err = 0; switch(c) { case 's': { - char *arg = va_arg(ap, char*); + char *arg = va_arg(*ap, char*); ucx_buffer_puts(buf, arg); break; } case 'd': { - int arg = va_arg(ap, int); + int arg = va_arg(*ap, int); ucx_bprintf(buf, "%d", arg); break; } case 'u': { - unsigned int arg = va_arg(ap, unsigned int); + unsigned int arg = va_arg(*ap, unsigned int); ucx_bprintf(buf, "%u", arg); break; } @@ -371,7 +371,7 @@ // get path string davqlerror_t error; - sstr_t path = dav_format_string(mp->allocator, st->path, ap, &error); + sstr_t path = dav_format_string(mp->allocator, st->path, &ap, &error); if(error) { // TODO: cleanup ucx_mempool_destroy(mp); @@ -640,7 +640,7 @@ } case DAVQL_STRING: { cmd.type = DAVQL_CMD_STRING; - cmd.data.string = dav_format_string(a, src, ap, &error); + cmd.data.string = dav_format_string(a, src, &ap, &error); ucx_buffer_write(&cmd, sizeof(cmd), 1, bcode); break; } diff -r a66e0a1f01fc -r ad45ba74fe1b libidav/davqlexec.h --- a/libidav/davqlexec.h Sat Oct 07 10:25:11 2017 +0200 +++ b/libidav/davqlexec.h Tue Dec 12 15:22:31 2017 +0100 @@ -138,7 +138,7 @@ DavResult dav_statement_execv(DavSession *sn, DavQLStatement *st, va_list ap); UcxBuffer* dav_path_string(sstr_t src, va_list ap, davqlerror_t *error); -sstr_t dav_format_string(UcxAllocator *a, sstr_t fstr, va_list ap, davqlerror_t *error); +sstr_t dav_format_string(UcxAllocator *a, sstr_t fstr, va_list *ap, davqlerror_t *error); DavResult dav_exec_select(DavSession *sn, DavQLStatement *st, va_list ap); diff -r a66e0a1f01fc -r ad45ba74fe1b libidav/webdav.c --- a/libidav/webdav.c Sat Oct 07 10:25:11 2017 +0200 +++ b/libidav/webdav.c Tue Dec 12 15:22:31 2017 +0100 @@ -374,7 +374,7 @@ } va_list ap; - va_start(ap, query); + va_start(ap, query); DavResult result = dav_statement_execv(sn, stmt, ap); va_end(ap);