X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/1df63930a063aa03a7bd09bb719803ea4820d4e1..2ad4aac7f0cb1c4981dfbe823bdebff8d7500515:/sbr/netsec.c diff --git a/sbr/netsec.c b/sbr/netsec.c index 01c25f5f..3f0ea221 100644 --- a/sbr/netsec.c +++ b/sbr/netsec.c @@ -6,10 +6,13 @@ * complete copyright information. */ -#include -#include -#include -#include +#include "h/mh.h" +#include "credentials.h" +#include "getcpy.h" +#include "brkstring.h" +#include "h/utils.h" +#include "h/netsec.h" +#include "h/oauth.h" #include #include #include "base64.h" @@ -807,6 +810,7 @@ netsec_vprintf(netsec_context *nsc, char **errstr, const char *format, va_list ap) { int rc; + va_list apcopy; /* * Cheat a little. If we can fit the data into our outgoing buffer, @@ -814,8 +818,10 @@ netsec_vprintf(netsec_context *nsc, char **errstr, const char *format, */ retry: + va_copy(apcopy, ap); rc = vsnprintf((char *) nsc->ns_outptr, - nsc->ns_outbufsize - nsc->ns_outbuflen, format, ap); + nsc->ns_outbufsize - nsc->ns_outbuflen, format, apcopy); + va_end(apcopy); if (rc >= (int) (nsc->ns_outbufsize - nsc->ns_outbuflen)) { /*