X-Git-Url: https://www.tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=lib%2Futils.c;h=d79532b233a2212fb28a74efbc8bc43f1e50b169;hp=be3126dc03a60e0889877266643edb2a6b212b0c;hb=438419734ebee38dc3f7390e5c8ae8e6ca2cb6cf;hpb=052fbc0bdf36e0dbe2a0867ce770d426c9a44841 diff --git a/lib/utils.c b/lib/utils.c index be3126dc..d79532b2 100644 --- a/lib/utils.c +++ b/lib/utils.c @@ -1,7 +1,7 @@ /* utils.c -- gathering of some stupid small functions - Copyright (C) 1999,2000 Ivo Timmermans - 2000 Guus Sliepen + Copyright (C) 1999-2001 Ivo Timmermans + 2000,2001 Guus Sliepen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -21,7 +21,6 @@ #include #include #include -#include #include "config.h" @@ -86,32 +85,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