From 83cd2267b309fa7411acaed356f88101196bb2ad Mon Sep 17 00:00:00 2001 From: Aleksey Veresov Date: Thu, 6 Feb 2020 19:43:57 +0300 Subject: [magi] Broken to become better. --- src/response.c | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) (limited to 'src/response.c') diff --git a/src/response.c b/src/response.c index 9570cd1..904b855 100644 --- a/src/response.c +++ b/src/response.c @@ -1,14 +1,10 @@ #include "response.h" -#include "inner_tools.h" -#include +#include "tools.h" #include #include #include -/* TODO: realise vsnprintf or eliminate need of it. (see musl) */ -int vsnprintf(char *s, size_t n, const char *format, va_list arg); - void magi_response_setup(magi_response *response) { @@ -46,24 +42,6 @@ void magi_response_add(magi_response *r, const char *addon) r->len += addon_len; } -void magi_response_add_format(magi_response *response, const char *addon, ...) -{ - char *act_addon; - int n; - va_list args; - va_start(args, addon); - n = vsnprintf(0, 0, addon, args); - va_end(args); - if (n >= 0) { - act_addon = malloc(n + 1); - va_start(args, addon); - vsnprintf(act_addon, n + 1, addon, args); - va_end(args); - magi_response_add(response, act_addon); - free(act_addon); - } -} - void magi_response_cookie(magi_response *response, magi_cookie *cookie) { magi_cookie_list_add(&response->cookies, cookie); -- cgit v1.2.3