Get rid of va_copy

This commit is contained in:
cpq committed 2022-09-23 08:59:02 +01:00
1 parent 1237185bb4
commit ebd931f7af
9 files changed
+16 -51

No files matched your search

+3 -6
View File
@@ -267,13 +267,10 @@ int mg_http_parse(const char *s, size_t len, struct mg_http_message *hm) {
}
static void mg_http_vprintf_chunk(struct mg_connection *c, const char *fmt,
va_list ap) {
va_list *ap) {
size_t len = c->send.len;
va_list tmp;
mg_send(c, " \r\n", 10);
va_copy(tmp, ap);
mg_vxprintf(mg_pfn_iobuf, &c->send, fmt, &tmp);
va_end(tmp);
mg_vxprintf(mg_pfn_iobuf, &c->send, fmt, ap);
if (c->send.len >= len + 10) {
mg_snprintf((char *) c->send.buf + len, 9, "%08lx", c->send.len - len - 10);
c->send.buf[len + 8] = '\r';
@@ -285,7 +282,7 @@ static void mg_http_vprintf_chunk(struct mg_connection *c, const char *fmt,
void mg_http_printf_chunk(struct mg_connection *c, const char *fmt, ...) {
va_list ap;
va_start(ap, fmt);
mg_http_vprintf_chunk(c, fmt, ap);
mg_http_vprintf_chunk(c, fmt, &ap);
va_end(ap);
}