Various fixes needed for Solaris.
[tinc] / lib / utils.c
index 26d3b49..fc9141f 100644 (file)
@@ -21,6 +21,7 @@
 #include <sys/types.h>
 #include <ctype.h>
 #include <string.h>
+#include <stdio.h>
 #include <stdarg.h>
 
 #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