X-Git-Url: https://tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=lib%2Futils.c;h=fc9141f1db517c15abca06661c484f6ac710c547;hp=26d3b49837eedc5fc6ff055cac58f2932ddca96d;hb=25a804c94ef0dbc4e5582ea6d8459d5f9a3fe06c;hpb=d3f889c8076dff9c00ebfe1459cb36425f8da41d diff --git a/lib/utils.c b/lib/utils.c index 26d3b498..fc9141f1 100644 --- a/lib/utils.c +++ b/lib/utils.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include "config.h" @@ -86,32 +87,3 @@ void cp_trace() ); } #endif - -#ifndef HAVE_ASPRINTF -int asprintf(char **buf, const char *fmt, ...) -{ - int status; - va_list ap; - int len; - - len = 4096; - *buf = xmalloc(len); - - va_start(ap, fmt); - status = vsnprintf (*buf, len, fmt, ap); - va_end (ap); - - if(status >= 0) - *buf = xrealloc(*buf, status); - - if(status > len-1) - { - len = status; - va_start(ap, fmt); - status = vsnprintf (*buf, len, fmt, ap); - va_end (ap); - } - - return status; -} -#endif